Skip to content
All components
Conversation

Marker

Label a position in a conversation, such as a date boundary, the start of unread messages or a change of context, without looking like a message.

A line that marks a position: a date, an unread divider.

Installation

tdpxl is not an npm dependency of your app. The @tdpxl/cli command (not published to npm yet) copies the source into your project, with the registry items and npm packages it imports.

npx @tdpxl/cli add marker

Then import it from @/components/ui/marker. New project? Start with the installation guide.

Examples

Each example is one branch of the official demo, rendered in its own frame. The code is that branch as you would write it, with imports pointing at the default install paths.

Separator

Mark a position in content using a separator treatment. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { Marker, MarkerContent } from "@/components/ui/marker"

export function MarkerSeparator() {
  return (
    <div className="flex w-full max-w-md flex-col gap-6">
      <Marker variant="separator">
        <MarkerContent>Today</MarkerContent>
      </Marker>
    </div>
  )
}

With icon

Compose an icon beside the marker label. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { SparklesIcon } from "lucide-react"

import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"

export function MarkerWithIcon() {
  return (
    <div className="flex w-full max-w-md flex-col gap-6">
      <Marker>
        <MarkerIcon>
          <SparklesIcon />
        </MarkerIcon>
        <MarkerContent>Switched to a different model</MarkerContent>
      </Marker>
    </div>
  )
}

Border

Mark a position in content using a bottom-border treatment. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { Marker, MarkerContent } from "@/components/ui/marker"

export function MarkerBorder() {
  return (
    <div className="flex w-full max-w-md flex-col gap-6">
      <Marker variant="border">
        <MarkerContent>Unread messages</MarkerContent>
      </Marker>
    </div>
  )
}

Date with time

Mark a date boundary with a machine-readable time. The label is human text and the time element carries the exact date. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { Marker, MarkerContent } from "@/components/ui/marker"

export function MarkerDateWithTime() {
  return (
    <div className="flex w-full max-w-md flex-col gap-6">
      <Marker variant="separator">
        <MarkerContent>
          <time dateTime="2026-11-16">Yesterday, 16 November</time>
        </MarkerContent>
      </Marker>
    </div>
  )
}

In conversation

Separate unread messages inside a conversation. The marker sits between messages and states how many are new in text. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { Bubble, BubbleContent } from "@/components/ui/bubble"
import { Marker, MarkerContent } from "@/components/ui/marker"
import { Message, MessageContent } from "@/components/ui/message"

export function MarkerInConversation() {
  return (
    <div className="flex w-full max-w-md flex-col gap-6">
      <div className="flex flex-col gap-4">
        <Message>
          <MessageContent>
            <Bubble variant="muted">
              <BubbleContent>Draft agenda is in the shared folder.</BubbleContent>
            </Bubble>
          </MessageContent>
        </Message>
        <Marker variant="separator">
          <MarkerContent>2 new messages</MarkerContent>
        </Marker>
        <Message>
          <MessageContent>
            <Bubble variant="muted">
              <BubbleContent>I added the hiring plan as item 2.</BubbleContent>
            </Bubble>
          </MessageContent>
        </Message>
      </div>
    </div>
  )
}

Long label

Wrap a long marker label at narrow widths. Long words break inside the label rather than widening the conversation. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { SparklesIcon } from "lucide-react"

import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"

export function MarkerLongLabel() {
  return (
    <div className="flex w-full max-w-md flex-col gap-6">
      <div className="w-full max-w-xs">
        <Marker>
          <MarkerIcon>
            <SparklesIcon aria-hidden="true" />
          </MarkerIcon>
          <MarkerContent>
            Conversation moved to the finance-planning-2026-quarterly-review workspace by an administrator
          </MarkerContent>
        </Marker>
      </div>
    </div>
  )
}

API reference

Generated from the component's TypeScript signatures. Inherited DOM and primitive props are listed separately.

Marker

A line that marks a position in a conversation: a date, an unread divider, a model change. It is a label, not a message, so it never carries an avatar.

Marker props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
variant"separator" | "border" | "default" | null | undefined"default"Marker presentation: default, separator or border. Icons compose through MarkerIcon; they are not a variant value.
Inherited props (13)
Marker inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLDivElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLDivElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLDivElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLDivElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLDivElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

MarkerContent

Content region within the root composition. Keep required providers, labels and related controls from the complete example.

MarkerContent props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
Inherited props (13)
MarkerContent inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLSpanElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLSpanElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLSpanElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLSpanElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLSpanElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLSpanElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLSpanElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

MarkerIcon

Icon container within the composition. Supply readable text or an accessible name when the icon conveys meaning.

MarkerIcon props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
Inherited props (13)
MarkerIcon inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLSpanElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLSpanElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLSpanElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLSpanElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLSpanElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLSpanElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLSpanElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

Accessibility & usage

From registry/ui/marker.meta.json (authored guidance; human review may still be pending). Behavior is checked by Storybook tests, not certified here.

When to use

  • Date dividers between days of a conversation.
  • An unread boundary that tells people where new messages start.
  • System events in a conversation: a model change, someone joining, a conversation moved.

When not to use

  • A plain visual divider with no label; use a separator.
  • A turn by a person or assistant; use a message.
  • Errors or warnings that need attention; use an alert.

Anatomy

Marker
The full-width row; variant default (label only), separator (rules on both sides, label centered) or border (rule underneath).
MarkerIcon
Optional leading icon; decorative unless it carries meaning, in which case give it text.
MarkerContent
The label; wraps long words so it never widens the conversation.

Keyboard & interaction

  • Markers are passive text: not focusable and no keyboard behavior; screen readers read the label in order between messages.
  • The separator rules are pseudo-elements and are not announced; only the label is.
  • If people need to jump to unread messages, add a separate button outside the marker.

Responsive behavior

  • Labels wrap onto several lines at narrow widths; with the separator variant the rules shrink so the label stays centered.
  • Keep labels short so the separator rules remain visible on phones.
  • Space markers from adjacent messages so they are not mistaken for message metadata.

Content guidelines

  • Dates: 'Today', 'Yesterday' and then full dates ('Monday, 16 November'), with an exact dateTime on a time element.
  • Unread: state the count when known ('2 new messages') or 'Unread messages'.
  • Events: say what happened in past tense ('Switched to a different model', 'Conversation moved to Finance').

Alternatives

  • Separator — An unlabeled visual or semantic division.
  • Message — A conversation turn with an author.
  • Alert — A status that needs attention or action.

Resources