Forms

Input

@xui/input

A non-interactive adornment pinned to the leading edge of an input — an icon, a currency symbol, a short prefix. Pointer events pass through to the input.

Install

pnpm add @xui/input

Add the barrel to a standalone component's imports:

import { XuiInputImports } from '@xui/input';

@Component({
  imports: [XuiInputImports],
  // …
})

Examples

Default

Loading preview…

Input group

Loading preview…

Color

Loading preview…

API

XuiInputLeftElement

directive[xuiInputLeftElement]

A non-interactive adornment pinned to the leading edge of an input — an icon, a currency symbol, a short prefix. Pointer events pass through to the input.

XuiInputRightElement

directive[xuiInputRightElement]

The trailing-edge counterpart of {@link XuiInputLeftElement} — often a button.

XuiInputGroup

componentxui-input-group

Frames a single [xuiInput] with optional leading/trailing elements and an optional clear button, reserving the padding the input needs so its text never runs under an adornment.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''clearablebooleanShow a clear button on the trailing edge whenever the input holds a value.false

XuiInput

directive[xuiInput]

Turns a native <input> (or <textarea>, <select>) into an xUI text field.

Variants

AxisOptionsDefaultsizesmmdlgmdsurfacedarklightdarkcolornoneprimarysuccesswarningerrornoneerrorautotrueauto

Inputs

NameTypeDefaultclassClassValueThe user-defined classes''sizeXuiInputVariants['size']Control height, from the shared control scale, so the field lines up with a button or select of the same size.this.config.sizesurfaceXuiInputVariants['surface']Which background the field sits on: inset (dark) or raised (light). Pick the one that contrasts with the surface around it, not the page theme.this.config.surfacecolorXuiInputVariants['color']A deliberate accent border, distinct from the automatic invalid state — use it to mark a field as noteworthy, not as wrong.this.config.colorerrorXuiInputVariants['error']Whether to render the error appearance. auto (the default) follows the bound control's error state; true forces it on. The tracker wins while it reports an error, so auto never hides a real validation failure.'auto'

Methods

setError(error: XuiInputVariants['error'])

Source

libs/ui/input/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.