Input
Takes one line of typed text, such as a name, an address or a search term.
Examples
Shown beside everything you post.
Variants
Align
Use letters, numbers and hyphens.
Type
States
Start with the country code, such as +44 20 7946 0000.
Your workspace owner can change it.
Usage
Use it when
- You type one line: a name, an address, a code, a search term.
- The value is free text the system cannot list as options.
- Something belongs inside the box: a search glyph, a fixed prefix such as a site address, or one action on the text such as Clear or Show. Use an InputGroup.
Use something else when
- The text runs past one line, such as notes or an agenda. Use Textarea instead.
- The value is one of up to 10 known options. Use Select instead; 2 to 4 options that fit in a row use SegmentedControl instead.
- The text picks from a long list of values. Use Combobox instead.
- The value is a count or an amount with a unit, such as nights or a price. Use NumberField instead, whose
formatwrites the unit. - The value is a day. Use DatePicker instead, with
typedfor a birth date or a day years away. - The value is a file. Use FileDrop instead.
- The field needs a description or an error. Use Field instead, which holds the Input and wires both to it.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/input.json https://kaanarici.com/r/cobalt/input-group.jsonimport { Input } from "@/components/cobalt/ui/input"import { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton } from "@/components/cobalt/ui/input-group"