ClickorKeyboard shortcut Alt + L

Dragto resize

Nord Design System SearchDeveloperDeveloperGetting startedUsing Web ComponentsWebfontsCDNLocalizationCSS Framework Legacy ESLint PluginWorking with AIFAQDesignDesignGetting startedFoundationsAccessibilityColor SystemColor UtilitiesPrinciplesFigma ToolkitGridIconographyNamingNordhealth BrandTypographyThemesBrand assetsToolsComponentsComponentsAccordion New Aside New Autocomplete New AvatarBadgeBannerButtonButton GroupCalendarCard Updated Chart New Chat New Chat AttachmentChat ComposerChat Composer DrawerChat Composer InputChat Dictation ButtonChat Layout Scroll ButtonChat MessageChat Message BubbleChat Message ListChat Message MetadataChat Send ButtonChat System MessageChat TokenChat Tokenized TextChat Tool CallsCheckboxCollapsible New Combobox New Command MenuData Table New Date PickerDate Range Picker New DividerDrawer Updated DropdownEmpty StateField New FieldsetFilter Bar New FooterHeaderIconInputInput Group New Item New Kbd New LayoutMessageMeter New Modal Updated NavigationNotificationNumber Field New Otp Field New Outline New Overflow List New Pagination New PopoutProgressProgress BarQrcodeRadioRangeResizable New Rich Text Editor New Scroll Area New Segmented ControlSelectSkeletonSpinnerStackTabTableTagTextareaTime Picker New Timestamp New ToastToggleTooltipTop BarTruncate New Visually HiddenDesign TokensDesign TokensTailwind CSSTailwind CSSBlocksBlocksTemplatesTemplatesIconsIconsPlaygroundPlaygroundLatest UpdatesLatest UpdatesChangelogChangelogMigration guidesMigration guides
GitHub

Clickto expandKeyboard shortcut Alt + L

Chat Composer Alpha Light DOM & Tailwind

Coordinates framework-neutral message input, supporting regions, submission, and stop behavior.

This component is considered alpha. We're still finalising the API, so it may include a breaking change at any time — use it at your own risk.

Usage

Chat Composer is the form shell for the Chat family. It supplies a Composer Input and Send Button when those regions are omitted, while preserving explicitly supplied consumer nodes.

import "@nordhealth/components/lib/ChatComposer"

Composition

State and events

Set the value JavaScript property and echo native input changes for controlled use, or omit it for uncontrolled state. disabled, loading, and stop-shown coordinate the registered input and send action. Slots support a drawer, header actions/context, input, footer actions, send actions, and a custom send button without changing DOM order.

Submitting emits cancelable nord-submit with the trimmed plain-string value. Stop mode emits cancelable nord-stop instead. Error and warning status records can render at the logical start or end.

Examples

Loading

Set loading while a send or response transition must not be repeated. The composer disables its registered input and send action together, then restores both when loading ends. Keep a nearby live status for work whose progress is not otherwise visible.

Compact layouts

Use density="compact" where vertical space is limited. Density changes spacing only: multiline entry, keyboard submission, validation, and the send action retain the same behavior as the default layout.

Accessibility

Give the composer a label which distinguishes it from the surrounding conversation. Keep controls in a logical source order, label every custom action, and use loading/disabled state only while the corresponding interaction is actually unavailable. Calling focus() forwards focus to the registered Composer Input.

API reference

ChatComposer

Framework-neutral chat composition shell with controlled/uncontrolled value, form submission, send/stop state, and named light-DOM composition regions. The component never re-renders consumer nodes. Use slot values drawer, header-actions, header-context, input, footer-actions, send-actions, and send-button to document each direct child's role. Source order remains the semantic and keyboard order in every framework.

<nord-chat-composer></nord-chat-composer>

Props

PropertyAttribute Description TypeDefault
valuevalueControlled canonical value. Omit for uncontrolled state.string | undefined
placeholderplaceholderPlaceholder forwarded to the registered input.string | undefined
disableddisabledDisables editing and sending.booleanfalse
loadingloadingMarks a send as pending and prevents duplicate sends.booleanfalse
stopShownstop-shownShows stop in place of send.booleanfalse
densitydensityComposer spacing density.ChatComposerDensity'balanced'
statusPositionstatus-positionLogical status placement.ChatComposerStatusPosition'bottom'

Slots

Slot name Description
drawerComposer Drawer or other context content.
header-actionsLeading compact actions.
header-contextTrailing context usage or progress.
inputComposer Input. A default is supplied when omitted.
footer-actionsLeading footer actions.
send-actionsActions immediately before send.
send-buttonSend Button. A default is supplied when omitted.

Methods

Method nameParameters Description
reportValidity() => booleanN/AValidates the registered input, or the containing form when there is one.
focus(options?: FocusOptions) => voidoptions: FocusOptionsFocuses the registered Composer Input.
EventDetail TypeDescription
nord-submitChatComposerSubmitEventCancellable trimmed submission.
nord-stopChatComposerStopEventCancellable stop intent.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-chat-composer-backgroundComposer surface.var(--n-color-surface)
--n-chat-composer-borderComposer border.var(--n-color-border)
--n-chat-composer-border-radiusOuter radius.var(--n-border-radius-s)
--n-chat-composer-paddingInner spacing.calc(var(--n-space-s)+var(--n-space-xs))
Light DOM & Tailwind. This component renders in the light DOM, so you can style it directly with your own CSS or Tailwind utility classes — there is no shadow boundary, and its default styles are low specificity, so your utilities win.