Components

Input Group

Add addons, buttons, and helper content to inputs.

PreviewSource
12 results
Example requirements
bun add --exact lucide-preact@1.55.0

Installation

Complete the project setup first. The init command configures TypeScript, Vite, Tailwind CSS v4, and Preact compatibility.

CLI

Run init once using the installation guide, then add this component. The CLI copies the required source files and installs their exact dependencies with Bun.

bunx --bun github:LiasCode/shadcn-preact#main add input-group

Add --dry-run to review the changes. Existing modified files are protected; use --overwrite only when you want to replace them.

Manual installation / degit (optional)

1. Install dependencies

bun add --exact class-variance-authority@0.7.1 cn@0.4.0 preact@11.0.1 tw-animate-css@1.4.0

2. Copy the component with degit

Run this from your project root. It selects input-group.tsx, its local dependencies, and both licenses directly from the repository, then copies them into src/components/ui.

bunx degit@3.10.0 https://github.com/LiasCode/shadcn-preact#main ./.cache/shadcn-preact/input-group --files LICENSE.md,registry/ui/button.tsx,registry/ui/input-group.tsx,registry/ui/input.tsx,registry/ui/lib/utils.ts,registry/ui/primitives/LICENSE,registry/ui/primitives/button/Button.tsx,registry/ui/primitives/button/index.ts,registry/ui/primitives/field/control/FieldControl.tsx,registry/ui/primitives/input/Input.tsx,registry/ui/primitives/input/index.ts,registry/ui/primitives/internals/FieldRootContext.ts,registry/ui/primitives/internals/FieldsetRootContext.ts,registry/ui/primitives/internals/LabelableContext.ts,registry/ui/primitives/internals/composite/root/CompositeRootContext.ts,registry/ui/primitives/internals/createBaseUIEventDetails.ts,registry/ui/primitives/internals/empty.ts,registry/ui/primitives/internals/getReactElementRef.ts,registry/ui/primitives/internals/getStateAttributesProps.ts,registry/ui/primitives/internals/mergeObjects.ts,registry/ui/primitives/internals/resolveClassName.ts,registry/ui/primitives/internals/resolveStyle.ts,registry/ui/primitives/internals/types.ts,registry/ui/primitives/internals/useButton.ts,registry/ui/primitives/internals/useFocusableWhenDisabled.ts,registry/ui/primitives/internals/useId.ts,registry/ui/primitives/internals/useIsoLayoutEffect.ts,registry/ui/primitives/internals/useMergedRefs.ts,registry/ui/primitives/internals/useRefWithInit.ts,registry/ui/primitives/internals/useRenderElement.ts,registry/ui/primitives/internals/useStableCallback.ts,registry/ui/primitives/merge-props/index.ts,registry/ui/textarea.tsx --force
mkdir -p ./src/components/ui
cp -R ./.cache/shadcn-preact/input-group/registry/ui/. ./src/components/ui/
cp ./.cache/shadcn-preact/input-group/LICENSE.md ./src/components/ui/LICENSE.md

The temporary copy lives in .cache/shadcn-preact/input-group. Existing components stay in place; shared source files are updated from main.

Selected source files (32)

Usage

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

Examples

inline-start

Use align="inline-start" to position the addon at the start of the input. This is the default.

inline-startSource

Icon positioned at the start.

Example requirements

Also uses: Field.

bun add --exact lucide-preact@1.55.0

inline-end

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

inline-endSource

Icon positioned at the end.

Example requirements

Also uses: Field.

bun add --exact lucide-preact@1.55.0

block-start

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

block-startSource
Full Name

Header positioned above the input.

script.js

Header positioned above the textarea.

Example requirements

Also uses: Field.

bun add --exact lucide-preact@1.55.0

block-end

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

block-endSource
USD

Footer positioned below the input.

0/280

Footer positioned below the textarea.

Example requirements

Also uses: Field.

Icon

Example requirements
bun add --exact lucide-preact@1.55.0

Text

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

Kbd

⌘K
Example requirements

Also uses: Kbd.

bun add --exact lucide-preact@1.55.0

Spinner

SpinnerSource
Saving...
Please wait...
Example requirements

Also uses: Spinner.

bun add --exact lucide-preact@1.55.0

Textarea

TextareaSource
Line 1, Column 1
script.js
Example requirements
bun add --exact lucide-preact@1.55.0

Custom Input

Add the data-slot="input-group-control" attribute to your custom input for automatic focus state handling.

Custom InputSource

Basic

BasicSource
Example requirements

Also uses: Field, Input.

Button Group

Button GroupSource
.com
Example requirements

Also uses: Button Group, Label.

bun add --exact lucide-preact@1.55.0

In Card

In CardSource
Card with Input Group
This is a card with an input group.
https://
0/500 characters
Example requirements

Also uses: Button, Card, Field.

bun add --exact lucide-preact@1.55.0

Textarea Examples

Textarea ExamplesSource

This is a description of the input group.

This is a description of the input group.

This is a description of the input group.

Ask, Search or Chat...

This is a description of the input group.

0/280 characters
script.js
Line 1, Column 1JavaScript
Example requirements

Also uses: Field, Textarea.

bun add --exact lucide-preact@1.55.0

With Buttons

With ButtonsSource
Example requirements

Also uses: Field.

bun add --exact lucide-preact@1.55.0

With Kbd

With KbdSource
⌘K
⌘K
Ask AI
Tab
CtrlC

This username is available.

12 results
Disabled

This is a description of the input group.

Example requirements

Also uses: Field, Kbd, Spinner.

bun add --exact lucide-preact@1.55.0

Reference

See the official Input Group documentation for composition patterns and API details. This page uses the Preact port and examples from the pinned upstream revision.

Component source