Skip to Content

Input

A form component that accepts single-line textual input from the user. 

Disabled

Use the disabled attr or the disabled class to disable a component.

Valid

Use the data-valid attr or the valid class to indicate an valid state.

Invalid

Use the data-invalid attr or the invalid class to indicate an invalid state.

Controlled

Use the value and onChange props when you need to control the value externally.

Uncontrolled

Use the name prop to include the value in the form submission.

Sizes

Use the input-{size} class to control the component size.

Size values can include:smmdlg.

For more information on all available sizing utilities, visit Tailwind 

Variants

Use the variant and palette classes to control the appereance of the component.

Variant values can include solidoutlinesurfacesubtle.
Color palettes can include primaryneutral. For extra palettes such as warning error and more, refer to the Colors section.

Customizing

globals.css
:root { --ex-input-font-family: var(--font-sans); --ex-input-font-weight: var(--font-weight-normal); --ex-input-font-size-sm: var(--text-xs); --ex-input-font-size-md: var(--text-sm); --ex-input-font-size-lg: var(--text-base); --ex-input-height-sm: calc(var(--spacing) * 9); --ex-input-height-md: calc(var(--spacing) * 10); --ex-input-height-lg: calc(var(--spacing) * 12); --ex-input-px-sm: calc(var(--spacing) * 3.5); --ex-input-px-md: calc(var(--spacing) * 4); --ex-input-px-lg: calc(var(--spacing) * 5); --ex-input-radius-sm: var(--radius-sm); --ex-input-radius-md: var(--radius-sm); --ex-input-radius-lg: var(--radius-sm); }

API

Input

ElementSelector
Input.ex-input
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Input Field

ElementSelector
Input.Field.ex-input-field
PropTypeDefault
asElementTypeinput
asChildbooleanfalse
Last updated on