Input group

One Input or Text area joined with text, icons, shortcuts and actions inside a single shared border.

<tp-input-group>
Input group
Default density Compact density Restart from the initial state Show the copyable source
K

Usage

The group owns the outside border and the focus and invalid ring; the editor inside keeps its native editing, validation and form value. Put exactly one tp-input, tp-text-area or native editor in the default slot, and label it with a Field as usual.

A group label does not replace an editor label. The group has no second value, submit event, or validation controller: configure and observe those APIs on the editor or Form.

Addons

inline-start and inline-end hold text or icons beside the editor. Clicking a non-interactive addon focuses the editor, so units and prefixes behave like part of the field.

prefix follows addonPosition; suffix is always at the inline end. Empty regions occupy no space.

Text addons
Default density Compact density Restart from the initial state Show the copyable source
$ USD https:// .tweakpad.app

Addons also report status: a result count, a check for an accepted value, or a Spinner while the value is being verified or saved.

Status addons
Default density Compact density Restart from the initial state Show the copyable source
12 results

Actions

Buttons in the action slot sit after the editor and stay independently operable, even when the editor is read-only or disabled. action-variant and action-size set their defaults; an explicitly configured Button wins.

action sits after the editor, before the inline-end addon.

Actions
Default density Compact density Restart from the initial state Show the copyable source
Copy Apply

In a button group

An Input group can join a Button group as one member, beside Buttons or a static text segment, so a search field and its submit Button share one seamed edge.

Button group composition
Default density Compact density Restart from the initial state Show the copyable source
Search https://

Addon slots also take interactive components, such as a Menu that picks a country code or a Tooltip that explains the expected format. They keep their own focus and keyboard behavior; give an icon-only trigger an aria-label.

Interactive addons
Default density Compact density Restart from the initial state Show the copyable source
+1 United States +1 United Kingdom +44 Germany +49

Block edges

block-start and block-end span the group above and below the editor. With a Text area they make a composer: a context line on top, a character count and submit actions in the footer.

Put a Button in a block edge for a multiline composer footer; it retains its own Button configuration.

Composer
Default density Compact density Restart from the initial state Show the copyable source
Replying to Jonas Weber 0/280 Cancel Post reply

Native editors

A native textarea or input in the default slot shares the same border and focus ring and keeps all of its own behavior, for example a textarea that grows with its content through field-sizing: content.

Native textarea
Default density Compact density Restart from the initial state Show the copyable source
Markdown supported

States

The group reflects the editor’s disabled and invalid states on its border. Errors still come from the Field.

Disabled and invalid
Default density Compact density Restart from the initial state Show the copyable source
.tweakpad.app prj_

API Reference

Every element also accepts motion-policy.

Attributes

AttributePropertyTypeDefaultDescriptionaddon-positionaddonPositionEdge'inline-start'The edge the prefix slot sits at; move it to another edge without changing the markup.action-sizeactionSize'xs' | 'sm' | 'icon-xs' | 'icon-sm''xs'The size the Buttons in the action slot take unless they set their own; the icon-* sizes suit Icon-only actions.action-variantactionVariant'ghost' | 'default' | 'secondary' | 'destructive' | 'outline' | 'link''ghost'The paint the Buttons in the action slot take unless they set their own.

Slots

SlotDescriptiondefaultThe one editor: an Input, a Text area or a native input or textarea.inline-startText, an Icon or a small control before the editor.inline-endText, an Icon, a Kbd or a small control after the editor.block-startA line above the editor, across the whole group.block-endA line below the editor, across the whole group, such as a count and actions.prefixShort text before the editor, such as a currency sign; placed at addon-position.suffixShort text after the editor, such as a unit.actionButtons right after the editor; they take the group's action size and paint.

CSS parts

PartDescription::part(input-group)The shared border, focus ring and invalid state around the editor and its addons.::part(input-group-action)A Button in the action slot.::part(input-group-addon)The region at one edge that holds text, Icons and controls beside the editor.::part(input-group-control)The editor inside the group, whose own border gives way to the group's.::part(input-group-text)A text segment in an addon, such as a unit or a prefix.

Components, widgets and patterns that use this one.

Show more