Input
A text input field with focus and error states
A text input component with focus styles and support for error states via aria-invalid.
import { Input } from "@/components/ui/input";
export default function Example() {
return <Input placeholder="Email" type="email" />;
}
View Code
Installation
bash
liminal add input
Usage
import { Input } from "@/components/ui/input";
export default function Example() {
return <Input placeholder="Email" type="email" />;
}
View Code
Examples
Error state
Use aria-invalid="true" to show error styling. Pair with Label and error text for accessibility.
import { Input } from "@/components/ui/input";
export default function Example() {
return (
<Input
placeholder="Email"
type="email"
aria-invalid="true"
/>
);
}
View Code
API
| Prop | Type | Default | Description |
|---|---|---|---|
| type | string | "text" | Native input type (text, email, password, etc.). |
| placeholder | string | - | Placeholder text when empty. |
| aria-invalid | boolean | - | Set to true to show error border and styling. |