Input

A single-line text input with optional label, hint, and error messaging. Supports a floating label variant where the label animates inside the field.

Installation

npx dafink-ui add input

Demo

We will never share your email.

At least 8 characters.

Props

NameTypeDefaultDescription
labelstring-Visible label rendered above the input (default) or animated inside it (floating); also used to derive the input id.
placeholderstring-Placeholder text shown when the input is empty (default variant only).
hintstring-Helper text rendered below the input when there is no error.
errorstring-Error message; switches the input to error state and sets aria-invalid.
variant'default' | 'floating''default'floating animates the label inside the input field, acting as a placeholder until the field is focused or has a value.
disabledbooleanfalseDisables the input.