← All proposals

LabeledDivider

Net-new LabeledDivider: a horizontal rule with a pill-shaped label centered on it.

Net-new componentOpen in Storybook

proposals/LabeledDivider/HANDOFF.md133 lines · View on GitHub

Handoff: LabeledDivider

Rewritten 2026-11-20 against v2.0.0-beta.21 to the lessons template.

What and why

A horizontal rule with a pill label centered on it, to mark a point in a stream: a date, a jump in time or a state change such as "Zappy engaged". PDS v2 has no divider and nothing that labels a break in a stream, so event logs, runtime and edge logs, threads and agent event logs draw these by hand. The label can be swapped for any control with the action slot (for example a "Show more" Button that unfolds content under the divider, or a MenuButton time selector; the screen owns the control and what it does). Tones: neutral and agentic (AI gradient border, lines and shimmer).

On 2026-11-20 the component was cut back to the divider itself: the built-in time selector and date picker (menuItems, datePicker, id) were removed and became stories that compose the action slot.

Exploration and decisions

  • Named LabeledDivider because it is use-case neutral. If a plain Divider is added later, this can stay as the labeled form.
  • Selector and date picker are stories, not API (2026-11-20). The old component imported MenuButton, AgenticMenuButton, Datepicker, Modal and held state. It now has no hooks and no 'use client'. The time selector is action={<MenuButton ... />} (variant='agentic' for the agentic tone), plus a story-only Datepicker-in-Modal helper (proposals/_story-helpers/LabeledDividerSelector.tsx, not ported; L9).
  • Icons are prefixIcon and suffixIcon props.
  • Sizes xs and s (default), named after the type tokens. A medium size was dropped as too large.
  • Tones: neutral and agentic. The zappy icon on agentic is the plain foreground color.
  • Shimmer: the PDS shimmer band is an extra background layer on the agentic border and lines, using the package keyframes. Off for reduced motion. The label text does not shimmer.
  • Type uses the semantic pds-copy-s / pds-copy-xs classes on the root.

Full list and reasons: decisions.md.

API

LabeledDivider (a div; extends ComponentPropsWithoutRef<'div'>):

Prop Type Default Purpose
action ReactNode none Swaps the label for any control, centered on the line (a "Show more" Button, a MenuButton selector). The screen owns it. Ignores label and the icons; the root is a group.
className string none Additional class names.
label string none Text on the divider. Announced to screen readers on the static form. Set this or action; with neither, a dev warning is logged once ([LabeledDivider]).
prefixIcon IconProps['iconName'] none Icon before the label.
size 'xs' | 's' 's' Text size, icon size and label padding.
suffixIcon IconProps['iconName'] none Icon after the label.
tone 'neutral' | 'agentic' 'neutral' agentic: AI gradient border, lines and shimmer. With action it still colors the lines.

Removed on 2026-11-20 (from the earlier handoff and code): menuItems, datePicker, id, and the LabeledDividerDatePicker type.

Variants and states: sizes xs / s; tones neutral / agentic; static label or an action slot; with or without icons. Stories: Default, With Time Selector (action composition, story-only date picker), With Action, Agentic, All sizes and variants.

Tokens used

From labeled-divider.css as it is now:

  • --pds-animation-duration-ai-shimmer
  • --pds-border-radius-button
  • --pds-border-width-default
  • --pds-color-border-separator
  • --pds-color-foreground-default
  • --pds-color-surface-default
  • --pds-gradient-ai-active
  • --pds-gradient-ai-shimmer
  • --pds-spacing-2xs, --pds-spacing-3xs, --pds-spacing-4xs, --pds-spacing-m, --pds-spacing-s, --pds-spacing-xs

Also pds-copy-s / pds-copy-xs for type. The discovery status tokens listed in the earlier handoff are no longer used. --pds-spacing-2xs and --pds-spacing-l also appear in labeled-divider-story.css (story only).

Impact

From impact.md: no existing PDS component is changed and no --pds-* token is redefined. LogsTableWithDivider and EventLogWithAgent use it in stories. LogsTableWithDivider now composes the story-only selector helper; EventLogWithAgent uses static labels only and is unchanged. It no longer depends on MenuButton or AgenticMenuButton, so it is not blocked by them.

Reused vs net-new

  • Reused: the local Icon wrapper (only for the icons), the pds-copy-* classes, PDS gradient, shimmer and border tokens.
  • Net-new: .pds-labeled-divider (--agentic, --xs, __action, __icon, __label, __line); all props; custom CSS variables --labeled-divider-label-background, -label-border, -label-color, -line-color, -padding-block, -padding-inline. No raw values kept. Details in custom.md.

Accessibility

  • Static form: role='separator' with aria-label from label; the visible pill and both lines are aria-hidden, so the label is announced once.
  • action form: role='group'; the lines are aria-hidden. The control inside is the screen's, with its own name, keyboard handling and aria-expanded. See the Accessibility section of LabeledDivider.mdx.
  • The shimmer stops under prefers-reduced-motion.
  • Not checked: no a11y panel run and no look at light or dark in this rewrite.

Decisions and open questions

Each has a recommendation.

  • Vertical orientation for left-to-right event logs? Recommendation: no, add it when a screen needs it.
  • Should the divider own the unfolding (an isExpandable mode)? Recommendation: no, keep action a slot.
  • Selector and date picker. Recommendation: leave them as documented compositions of action and MenuButton; if a modal date picker is wanted as a pattern, raise it as its own proposal.
  • Is a modal the right container for the date picker, or a popover? Applies only to the story-only helper; Datepicker has no inline or controlled-open mode, so the pick takes two steps.
  • Dependencies: none of the proposals. The component imports only Icon.

Extension or new component

A new component: PDS v2 has no divider (checked, see Target-version check). It is not an extension of an existing component; the closest are the hr foundation (no label) and Timeline (a vertical rail), neither of which carries a label on a rule.

Footprint

Nothing draws outside the box. The root is display: flex; width: 100%. The label pill is flex-shrink: 0, so a long label does not shrink and can overflow a narrow parent; the lines are flex: 1 1 0 with a min-width of --pds-spacing-m, so the divider needs at least the pill width plus two minimum lines and gaps. The shimmer is a background layer (250% wide) inside the line and label boxes, not outside them. A parent that sets display: flex with a column direction and align-items other than stretch would shrink the divider; give it width: 100%.

In the Logs Table recipe the divider is positioned absolutely across a row; that CSS lives in the recipe, not here.

Dark mode and per-size values

No per-theme override in labeled-divider.css; colors come from theme-aware tokens. --pds-gradient-ai-active is defined once (light token file only), so the gradient is the same in both themes. Not checked by eye in either theme.

Size Type class Icon size Label padding (block / inline)
xs pds-copy-xs xs --pds-spacing-4xs / --pds-spacing-xs
s (default) pds-copy-s s --pds-spacing-3xs / --pds-spacing-s

Both sizes: gap --pds-spacing-s between the lines and the label, --pds-spacing-2xs between the icon and text, border --pds-border-width-default, radius --pds-border-radius-button. Footprint: the s pill is taller and wider than xs by the larger type size and padding; exact heights depend on the line height of the copy class (not measured).

Expect to change

  • label optional with a dev warning (L2). Recommendation: keep: either label or action is needed.
  • action as a free ReactNode (L11). Recommendation: keep as a slot; it replaced three props.
  • tone with neutral | agentic rather than a flag (isAgentic). Recommendation: keep as a tone; if the toolkit prefers a flag, isAgentic is a one-line change.
  • prefixIcon / suffixIcon as separate props. Recommendation: keep; the reference shows an icon on each side.
  • The role switches from separator to group when action is set. Recommendation: keep, a separator must not contain a control.

Target-version check

Checked against .pds-reference/src at v2.0.0-beta.21 (2026-11-20):

Item In the package at beta.21?
A labeled divider component no (no LabeledDivider or labeled divider component found)
--pds-gradient-ai-active, --pds-gradient-ai-shimmer, --pds-animation-duration-ai-shimmer yes (design tokens)
pds-ai-shimmer-sweep keyframes yes (src/core.css, ai-visuals.css)
pds-copy-s, pds-copy-xs yes (typography utilities)

Port notes

Would live in src/components/ (a dividers or layout category folder; generator npm run generate:component). Not yet matching v2: the local mergeClasses stand-in (use @libs/components/utils); the local Icon wrapper (use the package Icon). The component needs no 'use client' and no hooks. Relies on the package pds-ai-shimmer-sweep keyframes being loaded. pds-copy-* is !important, so a rule on the same element cannot override size or weight. The story-only LabeledDividerSelector helper is not ported.

Preview

npm run storybook, story Component Proposals / Labeled Divider. Figma: https://www.figma.com/design/AMGWJbraJoi2PKWnxo29Ah/PDS-Proposals?node-id=374-52