Input
A styled text input for collecting user data.
Import
import { Input } from '@oztix/roadie-components'
Examples
Default
<Input placeholder='Enter text' />
Sizes
<div className='grid gap-2'> <Input size='sm' placeholder='Small' /> <Input size='md' placeholder='Medium (default)' /> <Input size='lg' placeholder='Large' /> </div>
Emphasis
<div className='grid gap-2'> <Input emphasis='normal' placeholder='Normal emphasis' /> <Input emphasis='subtle' placeholder='Subtle emphasis' /> </div>
States
Inputs start neutral, gain an accent-coloured border and ring on focus, and switch to danger colouring when invalid.
Accessibility
- Label association: Always pair with a
<label>(orField.Label) using matchinghtmlFor/idattributes. - Validation: Set
aria-invalid="true"on invalid inputs.is-interactive-fieldprovides visual danger styling automatically. - Description: Use
aria-describedbyto link helper or error text to the input.
API reference
Input
intent?"neutral" | "brand" | "brand-secondary" | "accent" | "danger" | "success" | "warning" | "info" | null
emphasis?"normal" | "subtle" | null
size?"sm" | "md" | "lg" | null