Chat Layout
@astryxdesign/core v0.7.1 · ChatLayout
Props
| Prop | Type | Default | Description |
|---|---|---|---|
density | ChatDensity | 'balanced' | Spacing, bubble width, and the frosted dock. compact, balanced, or spacious. |
scrollRef | HTMLElement | 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. |
showScrollButton | boolean | true | Renders 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
| Slot | Description |
|---|---|
| (default) | Transcript. Usually one ChatMessageList. |
composer | Pinned to the bottom, above the frosted scrim. Usually one ChatComposer. |
empty | Shown when the default slot is omitted. Centered, so an EmptyState keeps a consistent look. |
scrollButton | Replaces the built-in scroll button. Receives isVisible, label, and scrollToBottom, which dismisses the new-message label and scrolls down. |
Exposed
| Name | Type | Description |
|---|---|---|
element | HTMLElement | null | The layout root. |
scrollToBottom | () => void | Dismisses the new-message state and scrolls to the latest message. |