Enter an address like name@company.com.
Installation
$ pnpm dlx shadcn@latest add @synccn/inputFirst time in this project? Connect synccn with one command.
Usage
import { Input, Label } from "@/components/ui/input";<Input icon={Search} placeholder="Search…" />API reference
Generated from the component's TypeScript types, so it always matches the code.
Input
PropTypeDescription
- icon
React.ElementTypeIcon shown inside the field on the left.
- invalid
booleanMarks the field invalid for styling and assistive tech.
- className
stringExtra classes for the root element.
Also accepts every standard <input> attribute, and forwards its ref.
Label
PropTypeDescription
- className
stringExtra classes for the root element.
Also accepts every standard <label> attribute, and forwards its ref.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-invalid
- Shows a visible focus ring for keyboard users
- Labels are tied to their controls
More inputs
ButtonSeven variants, four sizes and a built-in loading state.TextareaMulti-line field that grows with its content and counts characters.CheckboxChecked, unchecked and indeterminate, with label and description.SwitchToggle with a springy thumb in three sizes.Radio GroupPick one option, shown as dots or as selectable cards.SliderSingle value or range, with keyboard steps and value bubbles.