bearnie

Input Group

Add addons, buttons, and helper content to inputs.

Installation

npx bearnie add input-group
npx bearnie add input-group

Usage

import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
InputGroupText,
InputGroupTextarea,
} from "@/components/ui"
<InputGroup>
<InputGroupInput placeholder="Search..." />
<InputGroupAddon align="inline-start">
  <Search class="size-4" />
</InputGroupAddon>
</InputGroup>

Align

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.

inline-end

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

block-start

Use align="block-start" to position the addon above the input. Use layout="block" on InputGroup for vertical layouts.

Message

block-end

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

0/280

Examples

Icon

Text

https://
USD

Button

Kbd

K

Spinner

Multiple addons

USD

Clearable input

Textarea with actions

Add a comment

Markdown supported

Anatomy

  • InputGroup - The main container with unified focus handling
  • InputGroupAddon - Positions icons, text, or buttons relative to the input
  • InputGroupButton - Small button optimized for input groups
  • InputGroupInput - Styled input with focus state handling
  • InputGroupText - Static text display (e.g., “https://”, currency symbols)
  • InputGroupTextarea - Styled textarea with focus state handling

Props

InputGroup

PropTypeDefaultDescription
layoutinline | blockinlineLayout direction (inline for inputs, block for textareas)
classstring-Additional CSS classes

InputGroupAddon

PropTypeDefaultDescription
aligninline-start | inline-end | block-start | block-endinline-startPosition relative to input
classstring-Additional CSS classes

For InputGroupInput, use inline-start or inline-end alignment. For InputGroupTextarea, use block-start or block-end alignment.

InputGroupButton

PropTypeDefaultDescription
sizexs | sm | icon-xs | icon-smxsButton size
variantdefault | destructive | outline | secondary | ghost | linkghostButton variant
disabledbooleanfalseDisabled state
typebutton | submit | resetbuttonButton type
classstring-Additional CSS classes

InputGroupInput

All standard input props are supported, plus:

PropTypeDefaultDescription
typetext | email | password | search | tel | url | numbertextInput type
placeholderstring-Placeholder text
disabledbooleanfalseDisabled state
classstring-Additional CSS classes

InputGroupTextarea

All standard textarea props are supported, plus:

PropTypeDefaultDescription
placeholderstring-Placeholder text
rowsnumber4Number of visible rows
disabledbooleanfalseDisabled state
classstring-Additional CSS classes

InputGroupText

PropTypeDefaultDescription
classstring-Additional CSS classes