Documentation

Composer

A controlled, auto-growing text field with an integrated footer and send action. The application owns the draft, submission, errors, and queueing policy.

37%
Enter sends · Shift+Enter adds a line · IME composition never submits
const [draft, setDraft] = useState("");

<Composer
  aria-label="Message"
  value={draft}
  onValueChange={setDraft}
  onSubmit={() => send(draft)}
  footer={
    <Button size="small" bare color="secondary" onClick={openSettings}>
      Settings
    </Button>
  }
/>;
PropPurpose
value, onValueChangeControlled draft; never cleared implicitly
onSubmitCalled by Send or unmodified Enter; ignored for IME composition
footerCompact controls below the text
actionOptional replacement for the default send button
submitDisabledDisable submission while leaving the draft editable
submitLabelAccessible send label; defaults to “Send message”
embeddedTransparent surface for inline review or another container; retains focus feedback
material"glass" opts into a translucent, refractive surface; omitted keeps the default
glassThickness"thin", "regular", or "thick"; glass composers default to "thin"
jssRoot, jssSurface and textarea customization

Also accepts textarea attributes. Shift+Enter inserts a newline. Empty/whitespace drafts cannot submit. The field uses a single 1px neutral border that darkens on focus; footer controls receive their own keyboard indicators. Invalid input retains a red border.

The composer starts on one line, with its action beside the text. It grows as the draft wraps; actions stay at the bottom edge. footer controls sit before the action, while embedded retains the stacked layout. The default type is 14px/20px; growth is bounded at 180px. These defaults need no app-specific CSS. TextArea uses native field-sizing; use current browsers.

Glass material

material="glass" applies the shared glass material to the input frame. Buttons, cards, and inputs accept the same prop; glass() is available for custom JSS surfaces.

Compare composer styles and thicknesses in Visual System.

<Composer
  material="glass"
  value={draft}
  onValueChange={setDraft}
  onSubmit={() => send(draft)}
/>

The material does not change submission, growth, or footer layout. embedded takes precedence and remains transparent. glassThickness defaults to "thin": 5px blur with a 28% light / 32% dark tint. "regular" and "thick" are opt-in denser treatments. See Visual System for material usage and accessibility preferences.