Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Input Group

Wraps an input or textarea with addons aligned to either edge.

@logic2b.com

Installation

npx logic2b@next add input-group

Usage

import {
  InputGroup,
  InputGroupAddon,
  InputGroupInput,
  InputGroupText,
} from "@/components/ui/input-group"

<InputGroup>
  <InputGroupAddon>
    <SearchIcon />
  </InputGroupAddon>
  <InputGroupInput placeholder="Search..." />
</InputGroup>

Examples

With Button

Textarea

280 characters left

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<InputGroup
  aria-label="Budget amount"
>
  <InputGroupAddon>
    <InputGroupText>€</InputGroupText>
  </InputGroupAddon>
  <InputGroupInput
    type="text"
    defaultValue="2,400"
    aria-label="Amount"
    placeholder="Monthly budget"
   />
  <InputGroupAddon
    align="inline-end"
  >
    <InputGroupText>EUR</InputGroupText>
  </InputGroupAddon>
</InputGroup>

API reference

Generated from the public TypeScript exports in src/ui/input-group.tsx.

View JSON

InputGroup

Component
Props: React.ComponentProps<"div">

InputGroupAddon

Component
Props: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>
PropTypeRequiredDefaultDescription
alignnull | "inline-start" | "inline-end" | "block-start" | "block-end"No"inline-start"—

InputGroupButton

Component
Props: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>
PropTypeRequiredDefaultDescription
type"button" | "submit" | "reset"No"button"—
variantnull | "link" | "default" | "destructive" | "secondary" | "outline" | "ghost"No"ghost"—
sizenull | "sm" | "xs" | "icon-xs" | "icon-sm"No"xs"—

InputGroupText

Component
Props: React.ComponentProps<"span">

InputGroupInput

Component
Props: React.ComponentProps<"input">

InputGroupTextarea

Component
Props: React.ComponentProps<"textarea">

Accessibility contract

Machine-readable behavior and consumer responsibilities for input-group.

View JSON
Support
Composition contract
Pattern
composite input

Built-in semantics

  • The inner native input/textarea keeps its semantics; decorative addons can be hidden from assistive technology.

Consumer responsibilities

  • Label the inner control and give addon buttons accessible names.