Fulldev UI

Add addons, buttons, and helper content to inputs.

12 results

Installation

npx shadcn@latest add @fulldev/input-group

Usage

import {
  InputGroup,
  InputGroupAddon,
  InputGroupButton,
  InputGroupInput,
  InputGroupText,
  InputGroupTextarea,
} from "@/components/ui/input-group"
<InputGroup>
  <InputGroupInput placeholder="Search..." />
  <InputGroupAddon>
    <SearchIcon />
  </InputGroupAddon>
</InputGroup>

Composition

InputGroup
├── InputGroupInput or InputGroupTextarea
├── InputGroupAddon
├── InputGroupButton
└── InputGroupText

Align

Place InputGroupAddon after InputGroupInput or InputGroupTextarea in the DOM for correct focus order, then use its align prop to position it visually. Clicking an addon outside a button or link focuses the control.

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.

inline-end

Use align="inline-end" to position the addon at the end of the input.

Icon positioned at the end.

block-start

Use align="block-start" to position the addon above the input.

Full Name

Header positioned above the input.

script.js

Header positioned above the textarea.

block-end

Use align="block-end" to position the addon below the input.

USD

Footer positioned below the input.

0/280

Footer positioned below the textarea.

Icon

Text

$
USD
https://
.com
@company.com
120 characters left

Button

To open a popover or dropdown menu from an InputGroupButton, put the root inside the addon and give the button the trigger slot, such as data-slot="popover-trigger".

https://

Kbd

⌘K

Spinner

Saving...
Please wait...

Textarea

Line 1, Column 1
script.js

Custom Input

Add data-slot="input-group-control" to a custom control for the focus state and addon click handling. This one grows with its content through field-sizing-content.

RTL

١٢ نتيجة
جاري الحفظ...
٠/٢٨٠

تذييل موضع أسفل منطقة النص.

API Reference

Source: src/components/ui/input-group

InputGroupAddon

PropTypeDefault
align"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"

Use inline-start or inline-end with InputGroupInput, and block-start or block-end with InputGroupTextarea. An addon can hold several buttons, icons and texts.

InputGroupButton

PropTypeDefault
size"xs" | "icon-xs" | "sm" | "icon-sm""xs"
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""ghost"
type"button" | "submit" | "reset""button"

With href, it renders a link.

InputGroupInput and InputGroupTextarea

Replacements for Input and Textarea inside an input group. They pass all other attributes to the underlying control and set data-slot="input-group-control".