docs/components/input-group
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
Group input elements together.
PreviewCode
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/input-group
InputGroup
├── InputGroupAddon
├── InputGroupButton
├── InputGroupText
├── InputGroupInput
└── InputGroupTextarea
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
InputGroupText,
InputGroupTextarea,
} from "@/components/ui/input-group";
<InputGroup>
<InputGroupInput />
<InputGroupAddon>
<InputGroupText>https://</InputGroupText>
</InputGroupAddon>
</InputGroup>
Use the align prop to change the alignment of the input group.
PreviewCode
Filter
Icon positioned at the start.
PreviewCode
Password
Icon positioned at the end.
PreviewCode
Textarea
script.jsCopy
Header positioned above the textarea.
PreviewCode
Textarea
0/280Post
Footer positioned below the textarea.
Use the size prop to change the size of the input group.
PreviewCode
PreviewCode
PreviewCode
PreviewCode
PreviewCode
https://
PreviewCode
PreviewCode
Subscribe
PreviewCode
PreviewCode
Available
PreviewCode
⌘K
PreviewCode
Username
PreviewCode
PreviewCode
€
EUR
Use FieldGroup with textarea to build forms. Combine subject input, message textarea, and action buttons.
PreviewCode
script.js
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.
PreviewCode
Enter Your Password
Show PasswordClear Password
Weak Password
Wraps input with optional addons (labels, buttons, icons) on any side.
| Prop | Type | Default |
|---|---|---|
size | `"sm" | "md" |
className | string | - |
Holds addon content (labels, buttons, icons) beside the input.
| Prop | Type | Default |
|---|---|---|
align | `"inline-start" | "inline-end" |
className | string | - |
Button inside an addon. Typically used for reveal/hide, clear, or search.
| Prop | Type | Default |
|---|---|---|
size | ButtonSize | "xs" |
variant | ButtonVariant | "ghost" |
type | `"button" | "submit" |
className | string | - |
Static text label inside an addon.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Text input. Accepts all native input props.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Multi-line text input. Accepts all native textarea props.
| Prop | Type | Default |
|---|---|---|
className | string | - |
[
Previous page
Image Cropper ](/docs/components/image-cropper)[
Next page
Input OTP ](/docs/components/input-otp)
On This Page
InstallationAnatomyUsageAligninline-startinline-endblock-startblock-endSizeSmallMediumLargeStatesDisabledInvalidExamplesWith TooltipWith ButtonWith MenuWith BadgeWith Keyboard ShortcutWith Inner LabelWith SpinnerWith Number FieldWith Input GroupPassword Strength CheckerAPI ReferenceInputGroupInputGroupAddonInputGroupButtonInputGroupTextInputGroupInputInputGroupTextarea