base-ui-svelte

Input

A text input control.

View as Markdown

Sizes

Interactive

Value: Hello

API Reference

Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also accepted unless noted.

Input

Extends input HTML attributes.

PropertyTypeDefaultDescription
disabledbooleanfalseWhether the control ignores user interaction.
valuestring | undefinedControlled value.
defaultValuestringUncontrolled initial value.
onValueChange((value: string, event: Event) => void) | undefinedEvent handler called when the value changes.
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-dirtyPresent when the field value has changed.
data-disabledPresent when the part is disabled.
data-filledPresent when the field has a value.
data-focusedPresent when the field is focused.
data-invalidPresent when the field is invalid.
data-touchedPresent when the field has been touched.
data-validPresent when the field is valid.