Input
Interactive input field used to capture text and user data in the interface.
Installation
npx @glass-ui-kit/cli add inputUsage
Examples
Default
The standard input uses the default variant with the medium size.
Sizes
Use the size prop for the standard input scale. md is the default.
Variants
Use variants to change the surface treatment before reaching for custom classes.
Error State
Glass UI inputs do not use an error prop. Set aria-invalid="true" to opt into the built-in destructive border and focus ring.
Please enter a valid email address.
Form Composition
Use Field for the canonical one-field pattern. Input still works outside Field, but inside it can inherit ids, descriptions, and invalid state.
Join Our Newsletter
Stay updated with the latest releases and design system insights.
Product updates, release notes, and new component drops.
Password Toggle
Compose the base Input with an icon Button to create a custom password reveal toggle.
Disabled
The disabled state is automatically handled by the component using Tailwind’s native disabled attribute.
Styling
Input now follows the same prop-first API direction as Button. Reach for variant and size first, then use className as an escape hatch for one-off layout or state styling. When composed inside Field, explicit id, aria-describedby, and aria-invalid props still win.
API Reference
| Prop | Type |
|---|---|
variant | "default" | "soft" | "strong" | "transparent" |
size | "sm" | "md" | "lg" |
className | string |