- Accordion
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- ChatContainer
- ChatInput
- ChatMessage
- ChatMultiChoiceQuestion
- ChatMultiOptionQuestion
- ChatThinking
- Checkbox
- Combobox
- Container
- CurrencyInput
- DistributionSlider
- Drawer
- Dropdown
- FilePicker
- Grid
- Heading
- Image
- Input
- InputGroup
- Label
- Logo
- MapPin
- Markdown
- Modal
- NativeSelect
- NumberInput
- OptionSlider
- OtpInput
- PhoneInput
- Popover
- Progress
- PropertyCalendar
- RadioGroup
- RadioGroupCards
- ResponsiveModal
- ScrollArea
- SearchBar
- SearchBarFallback
- SearchInput
- Select
- Separator
- Spinner
- Switch
- Table
- Tabs
- Text
- Textarea
- TimePicker
- Toast
- Toggle
- ToggleCard
- ToggleGroup
- Toolbar
- Tooltip
Input
Text input field component for forms with consistent styling and accessibility
pnpm add @wandercom/design-system-web
5 lines
import { Input } from '@wandercom/design-system-web/ui/input';
export function Example() {
return <Input type="email" placeholder="Email" />;
}Loading example...
Compose Input (via InputGroupInput) with the useCharacterLimit hook and InputGroupCharacterCount addon to display a live count/max counter. Any input — typing, paste, drop, IME — that would push the value past maxLength is rejected; the value can never exceed the cap. Plug your form library (React Hook Form, TanStack Form, Zod, etc.) into onValueChange to sync state.
Loading example...
22 lines
import {
InputGroup,
InputGroupAddon,
InputGroupCharacterCount,
InputGroupInput,
useCharacterLimit,
} from '@wandercom/design-system-web/ui/input-group';
export function Example() {
const { count, maxLength, inputProps } = useCharacterLimit({
maxLength: 40,
});
return (
<InputGroup>
<InputGroupInput {...inputProps} placeholder="Listing title" />
<InputGroupAddon align="inline-end">
<InputGroupCharacterCount count={count} maxLength={maxLength} />
</InputGroupAddon>
</InputGroup>
);
}size?:
'default' | 'sm'
Size variant of the input. Defaults to default.
type?:
string
HTML input type (text, email, password, file, etc.). Defaults to text.
placeholder?:
string
Placeholder text displayed when input is empty.
disabled?:
boolean
Disables the input field when true.
className?:
string
Additional CSS classes to apply.
ref?:
React.Ref<HTMLInputElement>
Forward ref to the underlying input element.