Skip to main content

Overview

LabeledSeparator composes Separator and Text into a named horizontal divider. Your application supplies the label and surrounding spacing.

Usage

Label placement and tone

labelPosition defaults to center, with a line on each side of the label. Use end to place the label after the leading line. The label accepts a string supplied and localized by your application. tone defaults to neutral. Use danger for a red marker with a medium-weight label and a thicker rule. Set hasStartMarker to add a small decorative cap at the beginning of the rule. The optional cap follows the shared calendar and chat line design.

Spacing and application state

The component fills its container and adds no outer margin. Use parent layout spacing or native style and className for margins and alignment. Keep offsets for adjacent avatars or calendar positions in your application. The component presents the supplied label. Your application decides where an unread boundary or calendar marker belongs and when it is visible.

Accessibility and composition

The root exposes one horizontal separator named from its label. The rule segments and optional start marker are decorative, so assistive technology does not announce extra separators. Native accessible attributes can provide a different name or description when needed. Native attributes, styles, class names, and ref target the outer div. Use render to compose another noninteractive element while forwarding the supplied props and ref. LabeledSeparatorProps is exported from twenty-ui/components/layout.

Migration

Replace the frontend LabeledDivider with LabeledSeparator. Rename textPosition to labelPosition, and use tone="danger" for the unread marker’s red appearance. Remove noMargin, since outer margins default to zero. Preserve the former default spacing with style={{ marginBlock: 'var(--t-spacing-3)' }} where needed.

Props

string
required
Text naming the separator. Supplied and localized by the caller.
boolean
default:"false"
Show a decorative cap at the beginning of the rule.
"center" | "end"
default:"center"
Place the label between two lines or at the end of one line.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
"danger" | "neutral"
default:"neutral"
Neutral divider or red marker with a thicker rule.