Skip to content

Chat Layout

@astryxdesign/core v0.7.1 · ChatLayout

Props ​

PropTypeDefaultDescription
densityChatDensity'balanced'Spacing, bubble width, and the frosted dock. compact, balanced, or spacious.
scrollRefHTMLElement | null—Element that scrolls instead of the layout root. Left unset, the layout itself scrolls and the dock sticks; set it and the dock becomes fixed over that element.
showScrollButtonbooleantrueRenders the built-in scroll-to-bottom button. Set it to false when the scrollButton slot should be the only control, or when there should be none.

Slots ​

SlotDescription
(default)Transcript. Usually one ChatMessageList.
composerPinned to the bottom, above the frosted scrim. Usually one ChatComposer.
emptyShown when the default slot is omitted. Centered, so an EmptyState keeps a consistent look.
scrollButtonReplaces the built-in scroll button. Receives isVisible, label, and scrollToBottom, which dismisses the new-message label and scrolls down.

Exposed ​

NameTypeDescription
elementHTMLElement | nullThe layout root.
scrollToBottom() => voidDismisses the new-message state and scrolls to the latest message.