A display heading with the marks an editor would make on it: a selection box with handles, a marker stroke, accent ink, a scribbled underline or a circle, plus a handwritten note with an arrow. The marks draw once when the heading scrolls into view, and the words stay plain for screen readers.
On this page
- Landing heroes
- Section headlines
- Launch pages
- Feature callouts
- Pricing headers
Examples
The marks
Vietnamese
Inside your own heading
A note on its own
Installation
npx knowns-ui@latest add marked-headingPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Marked Heading from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/marked-heading
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add marked-heading
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/marked-heading.tsx
- components/ui/knowns/marked-heading-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/marked-heading, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "marked-heading" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- children
string|ReactNode- A string with marks written as [words]{select}, {highlight}, {accent}, {scribble} or {circle}; a bracket without a known mark stays as written, and \[ is a literal bracket. Or your own nodes with Mark.
- as / size
ElementType / "md"|"lg"|"xl"|"2xl"- Default
"h2" / none - The heading element, and Display heading's size scale (48 to 124px). Without a size the heading keeps the font size you give it.
- note / noteCorner
ReactNode / "top-left"|"top-right"|"bottom-left"|"bottom-right"- Default
- / "top-right" - A HandNote above (top) or below (bottom) the heading at that side, with an arrow into it.
- reveal
"view"|"load"|"off"- Default
"view" - view plays once when the heading scrolls into view after load (on screen at load, it rests); load plays once on first paint by CSS alone, for a hero; off never plays.
- className / wrapperClassName
string- Classes for the heading, and for the wrapper that holds it and its note.
- Mark
{ kind, children, order?, seed?, className? }- Default
order 0 - One mark in your own nodes. order sets its place in the reveal (40ms apart, 4 steps at most); seed changes the hand-drawn stroke.
- MarkedText
{ children, reveal?, className? }- Default
reveal "view" - An inline run that plays marks the same way, for a heading you already have (a Hero title, a Display heading).
- HandNote
{ children, corner?, className? }- Default
corner "top-right" - The note on its own, in the flow, with its arrow pointing toward the content.
- --kn-mark / --kn-marker / --kn-hand-font
CSS- Default
--primary / ink at 30% / system handwriting faces - The ink of every mark (these demos set a blue, since the docs accent is the text colour), the marker colour, and the note's face. The system faces are Segoe Print, Bradley Hand, Noteworthy and Chalkboard SE, then cursive; set --kn-hand-font to a face you host for Vietnamese or a set look.
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | ReactNode | - | A string with marks written as [words]{select}, {highlight}, {accent}, {scribble} or {circle}; a bracket without a known mark stays as written, and \[ is a literal bracket. Or your own nodes with Mark. |
| as / size | ElementType / "md" | "lg" | "xl" | "2xl" | "h2" / none | The heading element, and Display heading's size scale (48 to 124px). Without a size the heading keeps the font size you give it. |
| note / noteCorner | ReactNode / "top-left" | "top-right" | "bottom-left" | "bottom-right" | - / "top-right" | A HandNote above (top) or below (bottom) the heading at that side, with an arrow into it. |
| reveal | "view" | "load" | "off" | "view" | view plays once when the heading scrolls into view after load (on screen at load, it rests); load plays once on first paint by CSS alone, for a hero; off never plays. |
| className / wrapperClassName | string | - | Classes for the heading, and for the wrapper that holds it and its note. |
| Mark | { kind, children, order?, seed?, className? } | order 0 | One mark in your own nodes. order sets its place in the reveal (40ms apart, 4 steps at most); seed changes the hand-drawn stroke. |
| MarkedText | { children, reveal?, className? } | reveal "view" | An inline run that plays marks the same way, for a heading you already have (a Hero title, a Display heading). |
| HandNote | { children, corner?, className? } | corner "top-right" | The note on its own, in the flow, with its arrow pointing toward the content. |
| --kn-mark / --kn-marker / --kn-hand-font | CSS | --primary / ink at 30% / system handwriting faces | The ink of every mark (these demos set a blue, since the docs accent is the text colour), the marker colour, and the note's face. The system faces are Segoe Print, Bradley Hand, Noteworthy and Chalkboard SE, then cursive; set --kn-hand-font to a face you host for Vietnamese or a set look. |
Accessibility
- Marks are decoration. Every stroke, box and handle is hidden from screen readers, and the heading reads as its plain words, without the bracket syntax.
- Marks are spans, not the mark element, so screen readers do not announce a highlight in the middle of a headline.
- The note is plain text outside the heading, so it does not change the heading's name; its arrow is hidden.
- Under reduced motion every mark shows in its final state and nothing draws.
- Accent and marker colours sit behind or on the text in the accent; keep the headline readable without them.
What it handles
- 01Marks words in a heading the way an editor marks a draft: a selection box with four handles, a marker stroke, accent ink, a scribbled underline or a circle.
- 02Takes the marks inline in a plain string, [every window]{select}, or as Mark nodes inside your own heading, a Display heading or a Hero title.
- 03Draws every stroke by hand from a seed in the words, so the server and the browser agree and two marks never look stamped.
- 04Adds a short handwritten-style note at any corner, with a curved arrow drawn into the heading, in the flow so it never covers the copy.
- 05Plays once when the heading scrolls into view: the box fades in and its handles pop, strokes draw left to right, the arrow comes last.
- 06Keeps the heading's words plain for screen readers; every mark is decoration.
States
- First render
- Marks drawn, at rest
- none
- Scrolls into view after load
- Box fades in, then handles pop; strokes draw left to right; marks 40ms apart; then the note and its arrow
- 180ms and 120ms ease out; strokes 280ms ease out
- reveal="load"
- The same, once, on first paint (CSS only)
- as above
- Reduced motion
- Final state
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Marks drawn, at rest | none |
| Scrolls into view after load | Box fades in, then handles pop; strokes draw left to right; marks 40ms apart; then the note and its arrow | 180ms and 120ms ease out; strokes 280ms ease out |
| reveal="load" | The same, once, on first paint (CSS only) | as above |
| Reduced motion | Final state | 0ms |
Works with
When to use
When to use
- A landing hero or section headline where one or two words carry the point, marked the way an editor marks a draft.
- A launch page that wants one hand-made moment: a handwritten note with an arrow beside the headline.
When not to use
- Logos in place of words: use Heading Mark.
- Running text and product UI: marks are for display headings, one or two per page.
- A plain headline with one accent word or a coloured full stop: use Display Heading.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Marked Heading to my app and wire it to my own data.
- I need a landing hero or section headline where one or two words carry the point, marked the way an editor marks a draft. Set that up with the Knowns UI Marked Heading.
- Which Marked Heading props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "marked-heading" }) and search_docs({ query: "marked heading" }).