Skip to content
Page

Marker

Inline status or timeline marker with an optional icon.

Switched to a new branch
Thinking...
Conversation compacted
Explored 4 files
import { Marker, MarkerContent, MarkerIcon, WebIcon } from "@pelagornis/page/components";

The preview above renders this file. Copy it into src/components/ to start from it.

src/components/MarkerExample.tsx
import {
Marker,
MarkerContent,
MarkerIcon,
Spinner,
Stack,
WebIcon,
} from "@pelagornis/page/components";
export default function MarkerDemo() {
return (
<Stack gap="sizeXXLarge" className="w-full">
<Marker>
<MarkerIcon>
<WebIcon name="git" size={16} color="currentColor" aria-hidden />
</MarkerIcon>
<MarkerContent>Switched to a new branch</MarkerContent>
</Marker>
<Marker role="status">
<MarkerIcon>
<Spinner size="sm" role="presentation" />
</MarkerIcon>
<MarkerContent>Thinking...</MarkerContent>
</Marker>
<Marker variant="divider">
<MarkerContent>Conversation compacted</MarkerContent>
</Marker>
<Marker>
<MarkerIcon>
<WebIcon name="search" size={16} color="currentColor" aria-hidden />
</MarkerIcon>
<MarkerContent>Explored 4 files</MarkerContent>
</Marker>
</Stack>
);
}

Marker is composed from parts that share React state. Children written in MDX are rendered as separate islands, so the parts can’t reach each other. Put the composition in a .tsx file, like the example above, and import that file instead.

src/content/docs/example.mdx
---
title: Example
---
import MarkerExample from "../../components/MarkerExample";
<MarkerExample client:load />

client:load hydrates the island on page load. Use client:visible for content far down the page.

Markdoc tags render Astro components, and this one needs client state. Wrap the example in an .astro file that hydrates it, then register that file as a tag.

src/components/markdoc/MarkerExample.astro
---
import MarkerExample from "../MarkerExample";
---
<MarkerExample client:load />
markdoc.config.mjs
import { component, defineMarkdocConfig } from "@astrojs/markdoc/config";
import starlightMarkdoc from "@astrojs/starlight-markdoc";
import pageMarkdoc from "@pelagornis/page/markdoc";
export default defineMarkdocConfig({
extends: [starlightMarkdoc(), pageMarkdoc()],
tags: {
"marker-example": {
render: component("./src/components/markdoc/MarkerExample.astro"),
selfClosing: true,
},
},
});
src/content/docs/example.mdoc
{% marker-example /%}

Values the component accepts for each variant prop.

PropValues
variantdefault divider

Parts of the component and the data-refineui role each one renders.

PartRole
rootmarker
iconmarker-icon
contentmarker-content

States the component styles. Component states are exposed as data attributes.

Keys the component handles when it has focus.