- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Input Group
Group input elements together.
Installation#
pnpm dlx shadcn@latest add @shark/input-group
Anatomy#
InputGroup ├── InputGroupAddon ├── InputGroupButton ├── InputGroupText ├── InputGroupInput └── InputGroupTextarea
Usage#
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, } from "@/components/ui/input-group";
<InputGroup> <InputGroupInput /> <InputGroupAddon> <InputGroupText>https://</InputGroupText> </InputGroupAddon> </InputGroup>
Align#
Use the align prop to change the alignment of the input group.
inline-start#
Icon positioned at the start.
inline-end#
Icon positioned at the end.
block-start#
Header positioned above the textarea.
block-end#
Footer positioned below the textarea.
Size#
Use the size prop to change the size of the input group.
Small#
Medium#
Large#
States#
Disabled#
Invalid#
Examples#
With Tooltip#
With Button#
With Menu#
With Badge#
With Keyboard Shortcut#
With Inner Label#
With Spinner#
With Number Field#
With Input Group#
Use FieldGroup with textarea to build forms. Combine subject input, message textarea, and action buttons.
Password Strength Checker#
A complete password checker with show/hide toggle, clear button, and real-time strength indicator. A strong password requires at least 8 characters with uppercase, lowercase, number, and special character.
API Reference#
InputGroup#
Wraps input with optional addons (labels, buttons, icons) on any side.
| Prop | Type | Default |
|---|---|---|
size | "sm" | "md" | "lg" | "md" |
className | string | - |
InputGroupAddon#
Holds addon content (labels, buttons, icons) beside the input.
| Prop | Type | Default |
|---|---|---|
align | "inline-start" | "inline-end" | "block-start" | "block-end" | "inline-start" |
className | string | - |
InputGroupButton#
Button inside an addon. Typically used for reveal/hide, clear, or search.
| Prop | Type | Default |
|---|---|---|
size | ButtonSize | "xs" |
variant | ButtonVariant | "ghost" |
type | "button" | "submit" | "reset" | "button" |
className | string | - |
InputGroupText#
Static text label inside an addon.
| Prop | Type | Default |
|---|---|---|
className | string | - |
InputGroupInput#
Text input. Accepts all native input props.
| Prop | Type | Default |
|---|---|---|
className | string | - |
InputGroupTextarea#
Multi-line text input. Accepts all native textarea props.
| Prop | Type | Default |
|---|---|---|
className | string | - |
On This Page