Input Group

Display additional information or actions inside an input.

12 results

Installation

pnpm dlx cubix@latest add input-group --base radix

Usage

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

Composition

Use the following composition to build an InputGroup:

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

Align

Use the align prop on InputGroupAddon to position the addon relative to the input. For proper focus management, place InputGroupAddon after the control in the DOM and use align for visual position.

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

https://

Kbd

⌘K

Dropdown

Spinner

Saving...
Please wait...

Textarea

Line 1, Column 1
script.js

API Reference

InputGroup

The main component that wraps inputs and addons.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

InputGroupAddon

Displays icons, text, buttons, or other content alongside inputs. Place it after the input in the DOM and set align for visual position. Prefer inline-* with InputGroupInput and block-* with InputGroupTextarea.

PropTypeDefaultDescription
align"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"Visual position of the addon. Place the addon after the control in the DOM for focus management.
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

InputGroupButton

Displays buttons within input groups.

PropTypeDefaultDescription
size"xs" | "icon-xs" | "sm" | "icon-sm""xs"Size of the button inside the input group.
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""ghost"Visual style of the button.
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

InputGroupInput

Replacement for Input inside groups. Uses data-slot="input-group-control" for focus styling.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

InputGroupTextarea

Replacement for Textarea inside groups.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

InputGroupText

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).