Theme
Install with your agentnpx shadcn@4.23.1 add @goop/meadow-input-group

Input group

Free

A text field with an action joined to it inside its fill, for React and Tailwind CSS. Free, MIT.

Type a web address after its https://, a weight before its kg, a handle checked as you type (teodora is taken), copy the invite link or the study id (the button says Copied, and the line under them what was copied), apply the code FIELD20 (it says Applied), and press / to filter the studies, the cross clearing the filter. The handle check is a list of three names behind a short wait; Apply only knows one code, behind a short wait. Copy puts the real words on your clipboard.

When to use

  • A text field with an action joined to it inside its fill.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Input group on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/meadow-input-group
PROMPT
Add the Goop Input group to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { InputGroupIcon, InputGroupText, InputGroupButton } from '@/components/ui/goop/input-group';

import { useState } from 'react';
import {
  InputGroup,
  InputGroupAddon,
  InputGroupClear,
  InputGroupIconButton,
  InputGroupInput,
} from '@/components/ui/goop/input-group';

function SiteLabelField({ onPickMarker }: { onPickMarker: () => void }) {
  const [label, setLabel] = useState('Mill');
  return (
    <InputGroup>
      <InputGroupAddon side="start">
        <InputGroupIconButton icon="tag" aria-label="Choose a site marker" onClick={onPickMarker} />
      </InputGroupAddon>
      <InputGroupInput
        aria-label="Site label"
        placeholder="Site label"
        value={label}
        onChange={(event) => setLabel(event.target.value)}
      />
      <InputGroupAddon side="end">
        <InputGroupClear aria-label="Clear the site label" />
      </InputGroupAddon>
    </InputGroup>
  );
}
  • Also known as: InputAddon, InputAdornment, InputAffix, TextFieldSlot, InputWithIcon.
  • height, width, padding, gap, corner, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
id?stringThe field's id, handed to the InputGroupInput (a Field's label points at it).
aria-describedby?stringWhat describes the field, handed to the InputGroupInput (a Field's description).
aria-invalid?ComponentProps<'input'>['aria-invalid']Marks the field invalid: its inside edge turns the danger colour.
disabled?booleanDisables the field and every button in the group; they fade to half.
size?'sm' | 'md' | 'lg' = 'md'The field's height: sm 36 px, md 44 px (the default) or lg, the same 44 px.
  • Types: InputGroupInputType = TextInputType
Parts
PartWhat it is
InputGroupInputThe field inside the group; type?: InputGroupInputType — The input's own type; left out, text; also takes value?: string; defaultValue?: string; onChange?: (event: ChangeEvent<HTMLInputElement>) => void; name?: string; required?: boolean; disabled?: boolean; form?: string
InputGroupAddonA holder for one action at the start or the end of the field (side), laid over the field's fill and as tall as it; the field's words make room for it; side: start (default), end
InputGroupIconA pack icon in a holder; icon: IconName — The pack icon's own name
InputGroupTextA short text in a holder — "https
InputGroupButtonA button of words in an end holder ("Apply", "Copy"); its props: input-group--button.md
InputGroupIconButtonThe action joined to the field; its props: input-group--icon-button.md
InputGroupClearThe clear button at the field's end, in an InputGroupAddon side="end"; its props: input-group--clear.md
  • Class recipes (cva): inputGroupAddonVariants (InputGroupAddon)
  • data-slot values (to select a part by): input-group, input-group-addon, input-group-button, input-group-button-status, input-group-clear, input-group-icon, input-group-icon-button, input-group-icon-button-status, input-group-input, input-group-text

InputGroupButton

A button of words in an end holder ("Apply", "Copy").

TSX
import { InputGroupButton } from '@/components/ui/goop/input-group';

Options

  • copy?: boolean | string — Copies on a press: true copies the field's value as it is at the press, a text copies that text.
  • doneLabel?: string — The words once the press has done its work, shown with the check for 2 s: "Copied" by default on a copy button; on another button your own word ("Applied"), shown once its onClick's promise resolves (at once when it returns no promise).
  • failedLabel?: string — The words when a copy found no clipboard or the browser refused it (default "Couldn’t copy").
  • onCopy?: (value: string) => void — Called with the copied text once it is on the clipboard (never when the copy failed).
  • onClick?: (event: MouseEvent<HTMLButtonElement>) => unknown — The press, and with doneLabel its work: a promise it returns that resolves shows doneLabel, while one that resolves to false or rejects shows nothing, nor does a press whose handler calls event.preventDefault().
  • Also takes: type?: 'button' | 'submit' | 'reset'; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'

InputGroupClear

The clear button at the field's end, in an InputGroupAddon side="end".

TSX
import { InputGroupClear } from '@/components/ui/goop/input-group';

Options

  • onClick?: (event: MouseEvent<HTMLButtonElement>) => unknown — The press, and with doneLabel its work: a promise it returns that resolves shows doneLabel, while one that resolves to false or rejects shows nothing, nor does a press whose handler calls event.preventDefault().
  • children?: ReactNode — With asChild: the one element (a link) that becomes the button, the icon drawn in it.
  • aria-label?: string = 'Clear' — The button's name, read by a screen reader and shown in its tooltip; Clear by default.
  • onClear?: () => void — Called after the field is emptied (its onChange has had the empty value already).
  • Also takes: type?: 'button' | 'submit' | 'reset'; disabled?: boolean; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'

InputGroupIconButton

The action joined to the field.

TSX
import { InputGroupIconButton } from '@/components/ui/goop/input-group';

Options

  • copy?: boolean | string — Copies on a press: true copies the field's value as it is at the press, a text copies that text.
  • doneLabel?: string — The words once the press has done its work, shown with the check for 2 s: "Copied" by default on a copy button; on another button your own word ("Applied"), shown once its onClick's promise resolves (at once when it returns no promise).
  • failedLabel?: string — The words when a copy found no clipboard or the browser refused it (default "Couldn’t copy").
  • onCopy?: (value: string) => void — Called with the copied text once it is on the clipboard (never when the copy failed).
  • onClick?: (event: MouseEvent<HTMLButtonElement>) => unknown — The press, and with doneLabel its work: a promise it returns that resolves shows doneLabel, while one that resolves to false or rejects shows nothing, nor does a press whose handler calls event.preventDefault().
  • icon: IconName — The pack icon's own name.
  • aria-label: string — The button's name: an icon-only button has no words to be named by.
  • children?: ReactNode — With asChild: the one element (a link) that becomes the button, the icon drawn in it.
  • Also takes: asChild?: boolean; type?: 'button' | 'submit' | 'reset'; disabled?: boolean; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'

Accessibility

  • The native element answers the keyboard.
  • hover, active: the browser's own (:hover, :active): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
focus-visiblethe attribute data-focus-visible
pressedthe attribute aria-pressed
expandedthe attribute data-state=open
openthe attribute data-state=open
disabledthe prop disabled
invalidthe attribute aria-invalid

Motion

  • The part sets its own motion: add no transition or animation of your own.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/input-group.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/meadow-input-group

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.