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
@marktiderman/genesis-ui/patternsimport { ComposerBar } from "@marktiderman/genesis-ui/patterns";react-docgen-typescript.ComposerBar
| Prop | Type | Default | Description |
|---|---|---|---|
| onChangeText* | (text: string) => void | — | |
| onSend* | () => void | — | |
| value* | string | — | |
| above | ReactNode | — | |
| className | string | — | |
| disabled | boolean | false | Turns sending off (besides a blank value). |
| leading | ReactNode | — | |
| maxLength | number | — | |
| maxLines | number | 6 | The input grows to this many lines, then scrolls. Default 6. |
| mode | string | — | The chosen mode's id. Default the first. |
| modes | readonly ComposerMode[] | — | Ways to send ("Reply", "Internal note"). Two or more show the picker. |
| modesLabel | string | Send as | The mode picker's name, for a screen reader. Default "Send as". |
| onModeChange | ((id: string) => void) | — | |
| placeholder | string | Message | |
| sending | boolean | false | A send is in flight: the button spins and won't send twice. |
| sendingLabel | string | Sending | |
| sendLabel | string | Send | Send's label, to a screen reader. Default "Send". |
| sendOn | enum | enter | Which key sends. Default `enter` (Shift+Enter for a new line; on a touch screen Enter adds a line). |
| testID | string | composer | |
| trailing | ReactNode | — |