Skip to content
hightouchUI

Design system

07570fe

Prompt input

Prompt input is the family of standalone pill-shaped pickers, toggles, and the submit button that make up the bottom action row of an LLM prompt input (also called a chat composer).

Example

PromptInput in this example is docs-only scaffolding, not a library export — the production prompt input container lives in the Hightouch app, so don't import it in product code. How it draws the chrome is documented in its source, docs/components/demos/prompt-input.js.

The prompt input can replace the action row with dictation controls while keeping the draft visible. This simulation demonstrates recording, transcription, and cancellation without accessing a microphone.

Simulated audio. No microphone access or message is sent.
Start with the microphone. Finish with ✓ to review the transcript, or cancel with ×.

Recording shows a scrolling waveform with a dotted baseline, varied peaks, and a soft opacity gradient. Cancel stays on the left and Finish on the right. While transcribing, the status text shimmers. Use × or Escape from the draft or recording controls to cancel and preserve the draft. With reduced motion enabled, a static recording label replaces the waveform and the transcription label does not shimmer.

In the app, CompactChatInput and LLMChatTextArea share DictationControl, DictationToolbar, and useComposerDictation; these are app components, not HTUI exports. The Styles composer uses minRows={2} and stackControls to reserve two lines above its controls.

Usage

Picker

A PromptInputMenuButton with variant="picker" shows its label and a chevron. It must be rendered inside a <Menu>, and the caller supplies the <MenuList> — the pill only styles the trigger. Use isPlaceholder for a prompt that hasn't been answered yet, and maxLabelWidth to cap how wide a long label grows before it starts fading out when the row has room. The label is masked with a fade rather than an ellipsis, so a truncated value never looks like part of the name.

In a flex row that runs out of room, a picker shrinks: its label fades out sooner, down to just the icon and chevron, instead of overflowing the row. Name the full selection in tooltip when the row can get narrow enough to hide it.

A pill holds a selection, so fill the menu with a filter menu FilterMenuGroup of type="radio" rather than plain menu items — the open menu then checks the current value, and the pill's label and its menu can't disagree. Keep the <Menu> root: it closes the menu on select, which a picker wants and FilterMenu deliberately doesn't do.

Compact

A PromptInputMenuButton with variant="compact" is icon-only until it's active, then it expands to reveal its label and picks up a tint. Pass onClear to add a hover-revealed X that clears the choice without opening the menu, and tone="warning" when the active state is something the user should notice.

Pill button

PromptInputPillButton is the pill itself, without the menu wiring. Reach for it when the pill drives something other than a Menu — an onClick that opens a drawer, or a custom trigger.

It's also the shape to pass to a combobox's trigger={{ type: "component", ... }} when the picker needs search. The combobox hands the trigger everything it needs (onClick, aria-label, disabled and loading state), so spread those props onto the pill — isLoading is accepted and ignored, since the pill has no loading treatment.

Pass isLazy={false} with any non-input trigger: it renders the search field inside the popover, and a lazily mounted popover focuses that field before it has been positioned, which scrolls the page to the top on first open. popoverWidth keeps the option list from being sized to the pill.

Pinned label

A compact PromptInputPillButton with isLabelPinned keeps its label visible while inactive. Use it when the label carries a value people need before they click, such as a count. The pill still tints only while active.

Active icon

activeIcon replaces a compact PromptInputPillButton's icon while it is active, and the two cross-fade in one slot. Use it when the glyph says what a press does next, such as a close mark on a pill that has opened a panel.

Size

size="sm" makes a PromptInputPillButton or PromptInputMenuButton 24px tall, the height of a chip. Use it for a pill that sits in a row of chips, and keep md in the action row under the textarea.

Toggle

PromptInputToggle is a pill that turns a mode on and off. It renders as aria-pressed, so it's announced as a toggle button rather than a menu, and ariaLabel is required: the visible label only appears while the toggle is active, so the accessible name has to stay constant.

Disabled pills

A disabled PromptInputPillButton drops its tooltip and shows disabledMessage instead, or nothing at all. A pill with a reason stays focusable, so keyboard users reach it too.

Submit button

PromptInputSubmitButton sends the completed prompt; its Stop action cancels a response after sending. Finishing app dictation instead adds an editable transcript to the draft for review before sending.

PromptInputSubmitButton owns every state of sending, plus the tooltip that explains it. It renders a primary circular icon button — reach for IconButton directly for any icon action that isn't submitting a prompt. The button sends only when the prompt input has content and neither isDisabled nor isLoading is set. When it is blocked, it shows disabledMessage if you pass one and stays silent if you don't. An empty prompt input (hasContent false) blocks it the same way isDisabled does. A blocked button with a reason stays focusable, so keyboard users reach it. While isLoading, passing onCancel turns the button into a Stop control, and omitting it shows a spinner instead.

Combinations

PromptInputMenuButton

One scenario throughout — each cell's menu holds the real option list with the shown value checked. For a picker, initial is the unanswered placeholder and active is a made selection; long label shows the overflow fade, and hovering any active compact cell reveals its clear ✕. PromptInputPillButton renders the same pixels as the menu button, so its states are covered here.

Initial
Active
Long label
Disabled
Picker
Compact · primary
Compact · warning
Compact · pinned label

PromptInputMenuButton, small

The same scenario at size="sm".

Initial
Active
Long label
Disabled
Picker
Compact · pinned label

PromptInputToggle

Initial
Active
Long label
Disabled
Primary
Warning

PromptInputSubmitButton

Empty
Ready
Disabled
Loading, cancellable
Loading

Guidelines

When to use

  • In the footer of a prompt input, for the row of controls that sits under the textarea.
  • For compact inline pickers and toggles that belong to the prompt being written — a scope selector, a mode switch, an output format.
  • For the send control of any prompt input, so submitting, blocking, and cancelling look and read the same across prompt surfaces.

When not to use

  • For selection in a general form, use a select or a combobox — those carry labels, validation, and form-field sizing that a pill deliberately drops.
  • For a page-level mode switch outside a prompt input, use a toggle button, a segmented control, or a switch.
  • For a generic dropdown trigger, use a menu with a plain MenuButton — the pill's shape only reads correctly inside a prompt input row.
  • For non-interactive status, use a badge.
  • Badge and BadgeButton are pill-shaped too, but they're labels: no expanding label, no menu, no toggle semantics, and no clear affordance. Reach for a prompt input pill only when the pill is a control in a prompt input.

Content

  • Write a disabledMessage the user can act on. "You need write access to change the brand" tells them what to do about it. "Disabled" repeats what they can already see.
  • Leave it off when there is no reason to give, and for states that last a moment such as a permission check in flight or a session being created. The tooltip is gone before it is read.
  • A compact pill hides its label until it is active, unless isLabelPinned keeps it visible. A disabled one without the pin shows only its icon, so name the control in the message as well as the reason.
  • Keep whatever control resolves the denial enabled. A message telling someone to pick a different model is no help if the model picker is disabled too.

Props

Every component inherits margin props.

PromptInputMenuButton

The menu-backed pill: the trigger inside a <Menu>, for choices that live in a dropdown. variant="picker" shows the current selection with a chevron, and shortens its label down to the icon and chevron in a row that runs out of room; variant="compact" is icon-only until active, then expands to reveal its label.

NameDefaultDescription
label

—

stringPill text. A compact pill reveals it while active, or at all times with isLabelPinned.
icon

—

ComponentType<SVGAttributes<SVGElement>>Leading glyph. A compact pill needs this or leadingAccessory; when both are passed, the glyph renders first.
leadingAccessory

—

ReactNodeCustom leading element, for content a plain glyph can't express. Size it to the glyph slot: promptInputPillIconSize (20px) at md, 16px at sm. An inactive compact pill is a disc that fits only that slot, so a wider accessory overflows it.
tooltip

—

stringHover hint. The pill owns its Tooltip. Silenced while disabled — pass disabledMessage for the reason instead.
disabledMessage

—

stringWhy the pill is disabled; shown as the tooltip in place of tooltip. Without it a disabled pill says nothing on hover.
maxLabelWidth"130px"stringWidth at which the label starts fading out when the row has room. A picker in a narrower row fades its label sooner, down to the icon.
isDisabledfalsebooleanToggles the disabled state.
size"md"keyof typeof promptInputPillSizesmd is the 32px pill of a prompt input's action row. sm is 24px, for a pill that sits in a row of chips.
variant

—

"picker" | "compact"A picker shows its label plus a chevron. In a row that runs out of room it shrinks, fading its label down to the icon and chevron.
isPlaceholderfalsebooleanRender the label muted, for a not-yet-selected prompt.
isActivefalsebooleanWhether the pill is expanded and tinted.
isLabelPinnedfalsebooleanKeep the label visible while inactive, for a label that carries a value such as a count. The pill still tints only while active.
activeIcon

—

ComponentType<SVGAttributes<SVGElement>>Glyph shown while active, in place of icon. The two cross-fade in one slot. Use it when the glyph says what a press does next, such as a close mark on a pill that has opened a panel.
tone"primary""primary" | "warning"Tint used while active.
onClear

—

() => voidActive only: hover-revealed X that clears without opening a menu.
clearAriaLabel"Remove"stringLabel of the clear X for screen readers.
ariaLabellabelstringLabel for screen readers.

PromptInputPillButton

The plain action pill: the same shape without menu wiring, for an onClick that drives something other than a Menu — a drawer, a custom trigger.

NameDefaultDescription
label

—

stringPill text. A compact pill reveals it while active, or at all times with isLabelPinned.
icon

—

ComponentType<SVGAttributes<SVGElement>>Leading glyph. A compact pill needs this or leadingAccessory; when both are passed, the glyph renders first.
leadingAccessory

—

ReactNodeCustom leading element, for content a plain glyph can't express. Size it to the glyph slot: promptInputPillIconSize (20px) at md, 16px at sm. An inactive compact pill is a disc that fits only that slot, so a wider accessory overflows it.
tooltip

—

stringHover hint. The pill owns its Tooltip. Silenced while disabled — pass disabledMessage for the reason instead.
disabledMessage

—

stringWhy the pill is disabled; shown as the tooltip in place of tooltip. Without it a disabled pill says nothing on hover.
maxLabelWidth"130px"stringWidth at which the label starts fading out when the row has room. A picker in a narrower row fades its label sooner, down to the icon.
isDisabledfalsebooleanToggles the disabled state.
size"md"keyof typeof promptInputPillSizesmd is the 32px pill of a prompt input's action row. sm is 24px, for a pill that sits in a row of chips.
variant

—

"picker" | "compact"A picker shows its label plus a chevron. In a row that runs out of room it shrinks, fading its label down to the icon and chevron.
isPlaceholderfalsebooleanRender the label muted, for a not-yet-selected prompt.
isActivefalsebooleanWhether the pill is expanded and tinted.
isLabelPinnedfalsebooleanKeep the label visible while inactive, for a label that carries a value such as a count. The pill still tints only while active.
activeIcon

—

ComponentType<SVGAttributes<SVGElement>>Glyph shown while active, in place of icon. The two cross-fade in one slot. Use it when the glyph says what a press does next, such as a close mark on a pill that has opened a panel.
tone"primary""primary" | "warning"Tint used while active.
onClear

—

() => voidActive only: hover-revealed X that clears without opening a menu.
clearAriaLabel"Remove"stringLabel of the clear X for screen readers.
isLoadingfalsebooleanAccepted so the pill can be a Combobox trigger.type: "component", and ignored — the pill has no loading treatment.

PromptInputToggle

The on/off pill: switches a mode and announces itself as a toggle (aria-pressed), revealing its label only while active.

NameDefaultDescription
label

—

stringPill text, revealed while active.
icon

—

ComponentType<SVGAttributes<SVGElement>>Leading glyph, always visible.
isActive

—

booleanWhether the toggle is on.
onToggle

—

() => voidCallback for when the toggle is clicked.
ariaLabel

—

stringLabel for screen readers, needed because the label is hidden while inactive.
tooltip

—

stringHover hint. Silenced while disabled — pass disabledMessage for the reason instead.
isDisabledfalsebooleanToggles the disabled state.
disabledMessage

—

stringWhy the toggle is disabled; shown as the tooltip in place of tooltip. Without it a disabled toggle says nothing on hover.
tone"primary""primary" | "warning"Tint used while active.

PromptInputSubmitButton

The send control: owns every state of sending — idle, active, blocked with a disabledMessage, and loading with an optional Stop — plus the tooltip that explains it. It builds on the primary circular IconButton; use it for sending or stopping a prompt input, and plain IconButton for every other icon action.

NameDefaultDescription
hasContent

—

booleanWhether the prompt input has something to send. An empty prompt input renders the button idle and disabled.
isDisabledfalsebooleanBlocks sending even when the prompt input has content.
isLoadingfalsebooleanWhether a response is in flight.
onSubmit

—

() => voidCallback for when the prompt is submitted.
onCancel

—

() => voidWhile loading: with onCancel the button becomes a Stop control; without it, a spinner.
disabledMessage

—

stringWhy sending is blocked; shown as the tooltip instead of the send hint.