Bubble

Bubble component is designed for chat-like interfaces, displaying messages with avatars and optional actions.

Example

Basic Usage
A simple bubble with avatar and message content:
View code
Alignment
Bubbles can be aligned to start (default) or end of the container, commonly used to differentiate between different users in a chat:
View code
Variant & ColorType
Bubbles outlook can be adjusted by variant and colorType props.
View code
Loading State
When loading is true, the bubble displays a spinner instead of the message content:
View code
Add interactive or informative elements like actionElement or message in the footer area, render corresponding status icon by passing the status prop
View code
Maximum Content Width
Control how much of the container width the message can occupy, default value is 75 in percentage.
View code
Loading state
View code
Hidden Avatar for Consecutive Messages
Use hidden avatars for consecutive messages from the same user by setting hidden prop to true:
View code
Avatar Placement
Bubbles can be aligned to top (default) or middle of the container, commonly used to differentiate between different users in a chat:
View code
Auto-scroll to Loading Bubble
BubbleList can automatically scroll to loading bubbles by using the scrollToLoading method attached to the ref.
The scrollToLoading method accepts an object as optional configuration
View code

Relevant components

API

Bubble
Prop nameTypeDefaultDescription
actionElementReactNode
actionPropsHTMLAttributes<HTMLDivElement>
alignmentBubbleAlignmentsstart
avatarReactNode
avatarPlacementAvatarPlacementsmiddle
colorstring
colorTypeColorTypes
contentPropsHTMLAttributes<HTMLDivElement>
footerPropsHTMLAttributes<HTMLDivElement>
maxContentWidthnumber75
The maximum width of the message container in percentage of the row width Default is 75(%)
messageReactNode
messagePropsTextProps
radiusnumber
renderStatusIcon(status: MessageStatus) => ReactNode
statusMessageStatus
variantBubbleVariantscontained
BubbleMarkdown
Prop nameTypeDefaultDescription
allowElementAllowElement
Filter elements (optional); allowedElements / disallowedElements is used first.
allowedElementsreadonly string[]
Tag names to allow (default: all tag names); cannot combine w/ disallowedElements.
childrenstring
Markdown.
componentsComponents
Map tag names to components.
disallowedElementsreadonly string[]
Tag names to disallow (default: []); cannot combine w/ allowedElements.
rehypePluginsPluggableList
List of rehype plugins to use.
remarkPluginsPluggableList
List of remark plugins to use.
remarkRehypeOptionsReadonly<Options>
Options to pass through to remark-rehype.
skipHtmlboolean
Ignore HTML in markdown completely (default: false).
unwrapDisallowedboolean
Extract (unwrap) what’s in disallowed elements (default: false); normally when say strong is not allowed, it and it’s children are dropped, with unwrapDisallowed the element itself is replaced by its children.
urlTransformUrlTransform
Change URLs (default: defaultUrlTransform)
Loading
ResetScrollButton
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
colorTypeColorTypes
Set color based on theme. If color is specified, that prop is used instead of this.
disabledboolean
Equivalent to button's disabled property.
keyboardClickKeysstring[]
loadingboolean
onBlurFocusEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
radiusstring
scrollOptionsScrollToOptions
sizeIconButtonSizes
springConfigPartial<AnimationConfig>
tooltipReactNode
tooltipPropsOmit<TooltipProps, "title" | "children">
variantIconButtonVariants
    Example
    Example
    Basic Usage
    Basic Usage
    Alignment
    Alignment
    Variant & ColorType
    Variant & ColorType
    Loading State
    Loading State
    Footer
    Footer
    Maximum Content Width
    Maximum Content Width
    Loading state
    Loading state
    Hidden Avatar for Consecutive Messages
    Hidden Avatar for Consecutive Messages
    Avatar Placement
    Avatar Placement
    Auto-scroll to Loading Bubble
    Auto-scroll to Loading Bubble
    Relevant components
    Relevant components
    API
    API
    Bubble
    Bubble
    BubbleMarkdown
    BubbleMarkdown
    Loading
    Loading
    ResetScrollButton
    ResetScrollButton
Coral is a thoroughly developed design system widely adopted by developers and designers for creating beautiful and user-friendly Sea internal products.

Copyright © 2018-2025 Sea Labs