- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
import Search from "@material-symbols/svg-400/rounded/search.svg?react"
import {Installation#
pnpm dlx shadcn@latest add @force-ui/input-group
Usage#
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
InputGroupText,
InputGroupTextarea,
} from "@/components/ui/input-group"<InputGroup>
<InputGroupInput placeholder="Search..." />
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
</InputGroup>Composition#
Use the following composition to build an InputGroup:
InputGroup
├── InputGroupInput or InputGroupTextarea
├── InputGroupAddon
├── InputGroupButton
└── InputGroupTextAlign#
Use the align prop on InputGroupAddon to position the addon relative to the input.
For proper focus management, InputGroupAddon should always be placed after
InputGroupInput or InputGroupTextarea in the DOM. Use the align prop to
visually position the addon.
inline-start#
Use align="inline-start" to position the addon at the start of the input. This is the default.
Icon positioned at the start.
import SearchIcon from "@material-symbols/svg-400/rounded/search.svg?react"
import {inline-end#
Use align="inline-end" to position the addon at the end of the input.
Icon positioned at the end.
import EyeOffIcon from "@material-symbols/svg-400/rounded/visibility_off.svg?react"
import {block-start#
Use align="block-start" to position the addon above the input.
Header positioned above the input.
Header positioned above the textarea.
import CopyIcon from "@material-symbols/svg-400/rounded/content_copy.svg?react"
import FileCodeIcon from "@material-symbols/svg-400/rounded/code.svg?react"
block-end#
Use align="block-end" to position the addon below the input.
Footer positioned below the input.
Footer positioned below the textarea.
import {
Field,
FieldDescription,Icon#
import CheckIcon from "@material-symbols/svg-400/rounded/check.svg?react"
import CreditCardIcon from "@material-symbols/svg-400/rounded/credit_card.svg?react"
import InfoIcon from "@material-symbols/svg-400/rounded/info.svg?react"Text#
import {
InputGroup,
InputGroupAddon,Button#
"use client"
import * as React from "react"Kbd#
import SearchIcon from "@material-symbols/svg-400/rounded/search.svg?react"
import {Dropdown#
"use client"
import ChevronDownIcon from "@material-symbols/svg-400/rounded/keyboard_arrow_down.svg?react"Spinner#
import LoaderIcon from "@material-symbols/svg-400/rounded/progress_activity.svg?react"
import {Textarea#
import IconBrandJavascript from "@material-symbols/svg-400/rounded/javascript.svg?react"
import IconCopy from "@material-symbols/svg-400/rounded/content_copy.svg?react"
import IconCornerDownLeft from "@material-symbols/svg-400/rounded/keyboard_return.svg?react"Custom Input#
Add the data-slot="input-group-control" attribute to your custom input for automatic focus state handling.
Here's an example of a custom resizable textarea from a third-party library.
"use client"
import TextareaAutosize from "react-textarea-autosize"Variants#
Use the variant prop to match standalone Input variants.
import {
InputGroup,
InputGroupInput,RTL#
To enable RTL support in Force UI, see the RTL configuration guide.
تذييل موضع أسفل منطقة النص.
"use client"
import * as React from "react"API Reference#
InputGroup#
The main component that wraps inputs and addons.
| Prop | Type | Default |
|---|---|---|
variant | "outline" | "filled" | "underline" | "ghost" | "outline" |
className | string |
<InputGroup>
<InputGroupInput />
<InputGroupAddon />
</InputGroup>InputGroupAddon#
Displays icons, text, buttons, or other content alongside inputs.
For proper focus navigation, the InputGroupAddon component should be placed
after the input. Set the align prop to position the addon.
| Prop | Type | Default |
|---|---|---|
align | "inline-start" | "inline-end" | "block-start" | "block-end" | "inline-start" |
className | string |
<InputGroupAddon align="inline-end">
<SearchIcon />
</InputGroupAddon>For <InputGroupInput />, use the inline-start or inline-end alignment. For <InputGroupTextarea />, use the block-start or block-end alignment.
The InputGroupAddon component can have multiple InputGroupButton components and icons.
<InputGroupAddon>
<InputGroupButton>Button</InputGroupButton>
<InputGroupButton>Button</InputGroupButton>
</InputGroupAddon>InputGroupButton#
Displays buttons within input groups.
| Prop | Type | Default |
|---|---|---|
size | "xs" | "icon-xs" | "sm" | "icon-sm" | "xs" |
variant | "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "ghost" |
className | string |
<InputGroupButton>Button</InputGroupButton>
<InputGroupButton size="icon-xs" aria-label="Copy">
<CopyIcon />
</InputGroupButton>InputGroupInput#
Replacement for <Input /> when building input groups. This component has the input group styles pre-applied and uses the unified data-slot="input-group-control" for focus state handling.
| Prop | Type | Default |
|---|---|---|
className | string |
All other props are passed through to the underlying <Input /> component.
<InputGroup>
<InputGroupInput placeholder="Enter text..." />
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
</InputGroup>InputGroupTextarea#
Replacement for <Textarea /> when building input groups. This component has the textarea group styles pre-applied and uses the unified data-slot="input-group-control" for focus state handling.
| Prop | Type | Default |
|---|---|---|
className | string |
All other props are passed through to the underlying <Textarea /> component.
<InputGroup>
<InputGroupTextarea placeholder="Enter message..." />
<InputGroupAddon align="block-end">
<InputGroupButton>Send</InputGroupButton>
</InputGroupAddon>
</InputGroup>