# Marker

An inline conversation status, bordered event row, or labeled separator.

Marker presents lightweight system notes and boundaries inside a conversation. Compose it with
[Message](/components/message/) or place it directly in a
[Message Scroller](/components/message-scroller/) between turns.

```tsx
import { CircleNotchIcon, GitBranchIcon, MagnifyingGlassIcon } from "@phosphor-icons/react";
import { Marker, Stack } from "@zentara-co/zenos-ui";

function MarkerExample() {
  return (
    <Stack gap="6" className="w-full max-w-xl py-2">
      <Marker>
        <Marker.Icon>
          <GitBranchIcon aria-hidden="true" />
        </Marker.Icon>
        <Marker.Content>Switched to a new branch</Marker.Content>
      </Marker>
      <Marker role="status">
        <Marker.Icon>
          <CircleNotchIcon aria-hidden="true" className="animate-spin motion-reduce:animate-none" />
        </Marker.Icon>
        <Marker.Content>Thinking...</Marker.Content>
      </Marker>
      <Marker variant="separator">
        <Marker.Content>Conversation compacted</Marker.Content>
      </Marker>
      <Marker>
        <Marker.Icon>
          <MagnifyingGlassIcon aria-hidden="true" />
        </Marker.Icon>
        <Marker.Content>Explored 4 files</Marker.Content>
      </Marker>
    </Stack>
  );
}
```

## Import

```tsx
import { Marker } from "@zentara-co/zenos-ui";
```

## Composition

Marker has a decorative icon slot and a content slot.

```tsx
<Marker>
  <Marker.Icon>
    <FolderIcon />
  </Marker.Icon>
  <Marker.Content>Explored 4 files</Marker.Content>
</Marker>
```

`Marker.Icon` always uses `aria-hidden="true"`. Put the marker's meaning in `Marker.Content`, or add
an accessible label to the root for an icon-only marker.

## Variants

- `default` is an inline status or note.
- `border` adds a decorative bottom boundary while keeping the same layout.
- `separator` centers a visible label between two decorative divider lines.

The labeled separator intentionally has no default `role`. A separator role makes descendants
presentational, which would prevent the visible text from being announced as ordinary content.

## Status updates

Add `role="status"` when a marker reports streaming or in-progress work that should be announced.
Avoid adding a live-region role to historical markers that are already present when the page loads.

```tsx
import { GearIcon, PulseIcon } from "@phosphor-icons/react";
import { Marker, Stack } from "@zentara-co/zenos-ui";

function MarkerStatusExample() {
  return (
    <Stack gap="3" className="w-full max-w-xl">
      <Marker role="status">
        <Marker.Icon>
          <GearIcon className="animate-spin motion-reduce:animate-none" />
        </Marker.Icon>
        <Marker.Content>Running security checks</Marker.Content>
      </Marker>
      <Marker role="status">
        <Marker.Icon>
          <PulseIcon />
        </Marker.Icon>
        <Marker.Content>Compacting conversation</Marker.Content>
      </Marker>
    </Stack>
  );
}
```

## Labeled separators

Use separator markers for dates, elapsed time, compacted history, or other readable boundaries.

```tsx
import { Marker, Stack } from "@zentara-co/zenos-ui";

function MarkerSeparatorExample() {
  return (
    <Stack gap="2" className="w-full max-w-xl">
      <Marker variant="separator">
        <Marker.Content>Today</Marker.Content>
      </Marker>
      <Marker variant="separator">
        <Marker.Content>Worked for 42 seconds</Marker.Content>
      </Marker>
      <Marker variant="separator">
        <Marker.Content>Conversation compacted</Marker.Content>
      </Marker>
    </Stack>
  );
}
```

## Links and buttons

Use `render` to compose Marker onto a native anchor or button. Interactive markers receive hover
and focus-visible affordances while keeping their native semantics.

```tsx
import { ArrowRightIcon, GearIcon } from "@phosphor-icons/react";
import { Marker, Stack } from "@zentara-co/zenos-ui";

function MarkerInteractiveExample() {
  return (
    <Stack gap="2" className="w-full max-w-xl">
      <Marker render={<a href="#pull-request" />}>
        <Marker.Icon>
          <ArrowRightIcon className="rtl:rotate-180" />
        </Marker.Icon>
        <Marker.Content>View the pull request</Marker.Content>
      </Marker>
      <Marker render={<button type="button" onClick={() => undefined} />}>
        <Marker.Icon>
          <GearIcon />
        </Marker.Icon>
        <Marker.Content>Retry the workspace sync</Marker.Content>
      </Marker>
    </Stack>
  );
}
```

```tsx
<Marker render={<a href="/pull/42" />}>
  <Marker.Content>View the pull request</Marker.Content>
</Marker>
```

## RTL

Marker relies on flex gaps rather than physical margins, so icons and content follow document
direction automatically. Divider lines remain balanced in both directions. Mirror directional icons
with `rtl:rotate-180` when their meaning changes direction.

## Variants

default, border, separator

## Anatomy

```text
Marker.Root
Marker.Icon
Marker.Content
```

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| border \| separator | default | Inline note, bordered event row, or labeled divider layout. |
| render | ReactElement \| ((props, state) => ReactElement) | — | Composes Marker props onto an anchor, button, or another element. |
| role | AriaRole | — | Use status for live progress; no role is supplied by default. |
| Icon | HTMLAttributes<HTMLSpanElement> | — | Decorative icon slot that is always hidden from assistive technology. |
| Content | HTMLAttributes<HTMLSpanElement> | — | Visible marker text with long-content wrapping. |
| native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

- Use `role="status"` only for live progress or streaming updates.
- Do not add `role="separator"` to a labeled separator; keep its text readable to assistive tech.
- Give an icon-only root an `aria-label`.
- Render interactive markers as real anchors or buttons through `render`.
- Do not rely on icon shape, border treatment, or position alone to communicate meaning.

The component is adapted to Zenos conventions from the [shadcn Marker pattern](https://ui.shadcn.com/docs/components/base/marker).

Source: https://zenos-ui.pages.dev/components/marker/