Input
A core component that allows users to enter text.
This component would not typically be used by itself. Instead, it can be used to compose more complex components such as a text input, search input, etc.
Installation
npx shadcn@latest add @tetra-ui/inputUsage
import { Input } from "@/components/ui/input";<Input placeholder="Enter your username" />Building custom inputs
The input module exports lower-level primitives for composing custom input components:
Input— styledTextInputwith theme-aware placeholder colorInputPressable— animated wrapper that handles focus ring and invalid statesInputAddon— slot for leading or trailing contentInputAddonIcon— sizes and styles icon childrenInputAddonButton— button styled for use inside an input addon
See Text Input, Search Input, and Action Input for composed examples.
API Reference
Input
Extends React Native TextInput props, omitting editable.
Prop
Type
InputPressable
Extends React Native Pressable props.
Prop
Type
InputAddon
Extends React Native View props.
Prop
Type
InputAddonIcon
Clones a single child icon with sizing and color classes.
Prop
Type
InputAddonButton
Extends Button props, omitting Button size.
Prop
Type
InputAddonButtonText
Same API as ButtonText. Must be used inside InputAddonButton.
InputAddonButtonIcon
Same API as ButtonIcon. Must be used inside InputAddonButton.