Genesis
@beta

ComposerBar

ComposerBar — the bar you write a message in, on the web: a textarea that grows with what you type (up to `maxLines`, then scrolls), a send button, and slots beside and above it. The web twin of ui-native's `NativeComposerBar`, with the same props, on the shared conversation contract (`@marktiderman/genesis-core/conversation`). - **Sending:** Enter sends and Shift+Enter adds a line (`sendOn="enter"`, the default), or Cmd/Ctrl+Enter sends (`sendOn="mod-enter"`, for long replies). Nothing sends while composing with an input method (Safari included, which reports the confirming Enter as keyCode 229). On a touch screen, Enter adds a line and the button sends, as in a phone's apps. - **Modes:** `modes` with a tone each ("Reply" / "Internal note"). Two or more show a picker above the input; an `internal` tone edges the bar and the input in the theme's `warning` colour and labels the input with the mode, so a staff-only note never reads like a reply. - **Slots:** `leading` (attach), `trailing` (beside send: a mic), `above` (a reply preview, attachments waiting to send). - **Accessibility:** the input is labelled; the mode picker is a single-choice toggle group (arrow keys move between modes); the send button stays put while sending, so focus stays on it, and "Sending" is announced politely from a region that's always there.

packages/ui/src/components/patterns/messaging/composer-bar.tsx

Import
Subpath export: @marktiderman/genesis-ui/patterns
import { ComposerBar } from "@marktiderman/genesis-ui/patterns";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

ComposerBar

PropTypeDefaultDescription
onChangeText*(text: string) => void—
onSend*() => void—
value*string—
aboveReactNode—
classNamestring—
disabledbooleanfalseTurns sending off (besides a blank value).
leadingReactNode—
maxLengthnumber—
maxLinesnumber6The input grows to this many lines, then scrolls. Default 6.
modestring—The chosen mode's id. Default the first.
modesreadonly ComposerMode[]—Ways to send ("Reply", "Internal note"). Two or more show the picker.
modesLabelstringSend asThe mode picker's name, for a screen reader. Default "Send as".
onModeChange((id: string) => void)—
placeholderstringMessage
sendingbooleanfalseA send is in flight: the button spins and won't send twice.
sendingLabelstringSending
sendLabelstringSendSend's label, to a screen reader. Default "Send".
sendOnenumenterWhich key sends. Default `enter` (Shift+Enter for a new line; on a touch screen Enter adds a line).
testIDstringcomposer
trailingReactNode—