Skip to content

Input ​

A customizable text input component with multiple types, variants, and validation states. Built with accessibility in mind and fully customizable through CSS custom properties.

Variants ​

Six visual variants for different UI contexts and levels of emphasis.

Full width

Colors ​

Six semantic colors for different contexts and validation states. Defaults to neutral when no color is specified.

Full width

Input Types ​

Different input types for various use cases.

Full width

Password Visibility ​

A type="password" input shows a reveal toggle inside the field. Pressing it swaps the field to plain text so the user can check what they typed, then back to dots; it announces itself to screen readers with a Show password / Hide password label and an aria-pressed state, and returns focus to the field after each toggle. No extra attribute is needed: the toggle appears automatically for password fields and is hidden (and removed from the tab order) otherwise.

Full width

Style the toggle through the pwd-toggle CSS part if the default icon or spacing needs adjusting.

Sizes ​

Three sizes for different contexts.

Full width

Rounded (Custom Border Radius) ​

Inputs default to --radius (8px at a 16px root). Use the rounded attribute to select another theme radius, including rounded="xl" for the previous 12px shape. Use it without a value (or rounded="full") for a pill shape.

Full width

Customization ​

Prefix & Suffix ​

Add prefix or suffix content like icons or clear buttons using slots.

Full width

Integrated Label ​

Use the label attribute to render an inset label inside the input field, creating a modern Material Design-style floating label effect. Always provide a label via the label attribute, aria-label, or an associated <label> element: do not rely on placeholder text as a label replacement, as placeholders disappear on input.

Full width

Label with Variants ​

Labels work seamlessly with all variants and colors.

Full width

Label with Prefix/Suffix ​

Combine labels with prefix and suffix slots for rich input fields.

Full width

Label Placement ​

Labels can be placed inside the input field (default) or above it.

Full width

Helper Text ​

Provide additional context or validation messages below the input using the helper attribute or slot.

Full width

States ​

Disabled & Readonly ​

Prevent interaction or modification of the input.

Full width

For first-run forms, combine a visible label, helper text, and progressive validation feedback.

Full width

API Reference ​

Attributes ​

AttributeTypeDefaultDescription
type'text' | 'email' | 'password' | 'search' | 'url' | 'tel' | 'number''text'Input type
valuestring''Current input value
namestring''Form field name
placeholderstring''Placeholder text
autocompletestringUnsetNative browser autofill hint
inputmode'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'UnsetNative virtual-keyboard layout hint
enterkeyhintEnterKeyHintUnsetNative virtual-keyboard return-key label
labelstring''Label text
label-placement'inset' | 'outside''inset'Label placement
helperstring''Helper text below input
disabledbooleanfalseDisable the input
readonlybooleanfalseMake the input read-only
clearablebooleanfalseShow a clear button when the field has a value
requiredbooleanfalseParticipate in native form validation while blank (read-only inputs are exempt)
fullwidthbooleanfalseExpand to full width
size'sm' | 'md' | 'lg''md'Input size
variant'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text''solid'Visual variant
color'primary' | 'secondary' | 'success' | 'warning' | 'error''primary'Color theme

Slots ​

SlotDescription
prefixContent before the input (e.g., icon)
suffixContent after the input (e.g., clear button, unit)
helperComplex helper content below the input

Events ​

EventDetailDescription
input{ value: string, originalEvent: Event }Emitted when the value changes (user input)
change{ value: string, originalEvent: Event }Emitted when value is committed (blur or Enter)

CSS Parts ​

PartElement
wrapperThe outer wrapper element
labelThe label element (inset or outside)
fieldThe field container element
input-rowThe input row container element
inputThe inner <input> element
status-iconThe inline error/success icon shown inside the field
spinnerThe inline loading spinner shown while loading
pwd-toggleThe password visibility toggle (only for type="password")
clearThe clear button (only when clearable and the field has a value)
helperThe helper text element

CSS Custom Properties ​

PropertyDescriptionDefault
--input-bgBackground colorVariant-dependent
--input-colorText colorVariant-dependent
--input-border-colorBorder colorVariant-dependent
--input-placeholder-colorPlaceholder text colorTheme-dependent
--input-radiusBorder radiusvar(--radius)
--input-paddingInner padding (block inline)Size-dependent
--input-gapGap between prefix/suffix icons and input textSize-dependent
--input-font-sizeFont sizeSize-dependent
--input-heightField heightSize-dependent
--input-hover-bgField background on hover (flat/ghost variants)Variant-dependent
--input-hover-border-colorField border on hover (flat/bordered variants)Variant-dependent
--input-focus-bgField background when focused (flat/bordered variants)Variant-dependent
--input-focus-border-colorField border when focused (flat/text variants)Variant-dependent

Accessibility ​

The input component follows WCAG 2.1 Level AA standards. Pressing Tab moves focus to the input, and native input behavior applies (e.g., Enter to commit). Proper ARIA states are reflected for disabled, required, and readonly conditions. Labels are associated via aria-label or <label> elements: always provide one through the label attribute, an explicit aria-label, or an associated <label> element. Use semantic colors (success, error, warning) to convey validation states alongside text, not color alone.