Components

Input

Collects a single line of input with optional validation styling.

tsx
import Input from '@precursor/input';

Example

Use a work address.
tsx
import Input from '@precursor/input';

export default function Example() {
    return (
        <>
            <label htmlFor="email">Email</label>
            <Input
                id="email"
                name="email"
                type="email"
                placeholder="you@example.com"
                aria-describedby="email-help"
            />
            <small id="email-help">Use a work address.</small>
        </>
    );
}

Props

Input props
PropTypeDefaultNotes
classNamestring——
aria-describedbystring——
aria-invalidboolean——
disabledboolean——
idstring——
nameRequiredstring——
placeholderstring——
typeInputTypes'text'—
defaultValuestring——
valuestring——
checkedboolean——
state"success" | "error" | "warning"——
size"s" | "m" | "l"——
onChangeChangeEventHandler<HTMLInputElement>——