doccupine 0.0.134 → 0.0.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -9
- package/dist/index.js +282 -46
- package/dist/lib/metadata.d.ts +5 -0
- package/dist/lib/metadata.js +15 -4
- package/dist/lib/rss.d.ts +24 -0
- package/dist/lib/rss.js +137 -0
- package/dist/lib/structures.js +22 -2
- package/dist/templates/app/rssRoute.d.ts +11 -0
- package/dist/templates/app/rssRoute.js +30 -0
- package/dist/templates/components/Docs.d.ts +1 -1
- package/dist/templates/components/Docs.js +5 -2
- package/dist/templates/components/MDXComponents.d.ts +1 -1
- package/dist/templates/components/MDXComponents.js +29 -0
- package/dist/templates/components/SideBar.d.ts +1 -1
- package/dist/templates/components/SideBar.js +5 -2
- package/dist/templates/components/layout/ActionBar.d.ts +1 -1
- package/dist/templates/components/layout/ActionBar.js +44 -13
- package/dist/templates/components/layout/ApiPlayground.d.ts +1 -1
- package/dist/templates/components/layout/ApiPlayground.js +20 -28
- package/dist/templates/components/layout/Badge.d.ts +1 -0
- package/dist/templates/components/layout/Badge.js +455 -0
- package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
- package/dist/templates/components/layout/DocsComponents.js +5 -30
- package/dist/templates/components/layout/Prompt.d.ts +1 -0
- package/dist/templates/components/layout/Prompt.js +149 -0
- package/dist/templates/components/layout/Tooltip.d.ts +1 -0
- package/dist/templates/components/layout/Tooltip.js +222 -0
- package/dist/templates/components/layout/Tree.d.ts +1 -0
- package/dist/templates/components/layout/Tree.js +322 -0
- package/dist/templates/components/layout/TreeData.d.ts +1 -0
- package/dist/templates/components/layout/TreeData.js +131 -0
- package/dist/templates/components/layout/Update.d.ts +1 -1
- package/dist/templates/components/layout/Update.js +3 -0
- package/dist/templates/lib/rss.d.ts +1 -0
- package/dist/templates/lib/rss.js +83 -0
- package/dist/templates/mdx/accordion.mdx.d.ts +1 -1
- package/dist/templates/mdx/accordion.mdx.js +1 -1
- package/dist/templates/mdx/api-playground.mdx.d.ts +1 -1
- package/dist/templates/mdx/api-playground.mdx.js +1 -1
- package/dist/templates/mdx/badges.mdx.d.ts +1 -0
- package/dist/templates/mdx/badges.mdx.js +237 -0
- package/dist/templates/mdx/buttons.mdx.d.ts +1 -1
- package/dist/templates/mdx/buttons.mdx.js +1 -1
- package/dist/templates/mdx/callouts.mdx.d.ts +1 -1
- package/dist/templates/mdx/callouts.mdx.js +1 -1
- package/dist/templates/mdx/cards.mdx.d.ts +1 -1
- package/dist/templates/mdx/cards.mdx.js +1 -1
- package/dist/templates/mdx/color-swatches.mdx.d.ts +1 -1
- package/dist/templates/mdx/color-swatches.mdx.js +1 -1
- package/dist/templates/mdx/columns.mdx.d.ts +1 -1
- package/dist/templates/mdx/columns.mdx.js +1 -1
- package/dist/templates/mdx/components.mdx.d.ts +1 -1
- package/dist/templates/mdx/components.mdx.js +14 -2
- package/dist/templates/mdx/fields.mdx.d.ts +1 -1
- package/dist/templates/mdx/fields.mdx.js +1 -1
- package/dist/templates/mdx/frames.mdx.d.ts +1 -1
- package/dist/templates/mdx/frames.mdx.js +1 -1
- package/dist/templates/mdx/icons.mdx.d.ts +1 -1
- package/dist/templates/mdx/icons.mdx.js +1 -1
- package/dist/templates/mdx/image-and-embeds.mdx.d.ts +1 -1
- package/dist/templates/mdx/image-and-embeds.mdx.js +1 -1
- package/dist/templates/mdx/images-and-embeds.mdx.d.ts +1 -0
- package/dist/templates/mdx/images-and-embeds.mdx.js +118 -0
- package/dist/templates/mdx/mermaid.mdx.d.ts +1 -1
- package/dist/templates/mdx/mermaid.mdx.js +1 -1
- package/dist/templates/mdx/navigation.mdx.d.ts +1 -1
- package/dist/templates/mdx/navigation.mdx.js +5 -1
- package/dist/templates/mdx/prompt.mdx.d.ts +1 -0
- package/dist/templates/mdx/prompt.mdx.js +69 -0
- package/dist/templates/mdx/steps.mdx.d.ts +1 -1
- package/dist/templates/mdx/steps.mdx.js +1 -1
- package/dist/templates/mdx/tabs.mdx.d.ts +1 -1
- package/dist/templates/mdx/tabs.mdx.js +1 -1
- package/dist/templates/mdx/tooltips.mdx.d.ts +1 -0
- package/dist/templates/mdx/tooltips.mdx.js +57 -0
- package/dist/templates/mdx/tree.mdx.d.ts +1 -0
- package/dist/templates/mdx/tree.mdx.js +158 -0
- package/dist/templates/mdx/update.mdx.d.ts +1 -1
- package/dist/templates/mdx/update.mdx.js +42 -2
- package/dist/templates/package.js +1 -1
- package/package.json +2 -2
- package/dist/templates/mdx/platform/external-links.mdx.d.ts +0 -1
- package/dist/templates/mdx/platform/external-links.mdx.js +0 -47
- package/dist/templates/utils/apiAnchors.d.ts +0 -1
- package/dist/templates/utils/apiAnchors.js +0 -39
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export const imagesAndEmbedsMdxTemplate = `---
|
|
2
|
+
title: "Images and embeds"
|
|
3
|
+
description: "Enrich your documentation with visuals, videos, and interactive embeds."
|
|
4
|
+
date: "2026-02-19"
|
|
5
|
+
category: "Components"
|
|
6
|
+
categoryOrder: 1
|
|
7
|
+
order: 14
|
|
8
|
+
---
|
|
9
|
+
# Images and embeds
|
|
10
|
+
|
|
11
|
+
Enrich your documentation with visuals, videos, and interactive embeds.
|
|
12
|
+
|
|
13
|
+
Display images, embed video content, or add interactive frames via iframes to supplement your docs.
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Images
|
|
18
|
+
|
|
19
|
+
Images enhance documentation with context, illustration, or decorative visual cues.
|
|
20
|
+
|
|
21
|
+
### Basic Image Syntax
|
|
22
|
+
|
|
23
|
+
Include an image in Markdown using the syntax below:
|
|
24
|
+
|
|
25
|
+
\`\`\`md
|
|
26
|
+

|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
<Callout type="note">
|
|
30
|
+
Use clear, descriptive alt text for accessibility and better SEO. Alt text should describe the image’s appearance or content.
|
|
31
|
+
</Callout>
|
|
32
|
+
|
|
33
|
+
### HTML image embeds
|
|
34
|
+
|
|
35
|
+
Embed images in your Markdown content using HTML syntax.
|
|
36
|
+
|
|
37
|
+
\`\`\`md
|
|
38
|
+
<img src="https://docs.doccupine.com/demo.png" alt="Alt text">
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
### Theme-aware images
|
|
42
|
+
|
|
43
|
+
Show different images depending on whether the user is in light or dark mode. Add the \`light-only\` or \`dark-only\` className to display an image exclusively in that theme.
|
|
44
|
+
|
|
45
|
+
\`\`\`md
|
|
46
|
+
<img className="light-only" src="/images/diagram-light.png" alt="Diagram">
|
|
47
|
+
<img className="dark-only" src="/images/diagram-dark.png" alt="Diagram">
|
|
48
|
+
\`\`\`
|
|
49
|
+
|
|
50
|
+
<img className="light-only" src="https://docs.doccupine.com/demo.png" alt="This image is only visible in light mode" />
|
|
51
|
+
<img className="dark-only" src="https://docs.doccupine.com/demo.png" alt="This image is only visible in dark mode" style={{ filter: "invert(1)" }} />
|
|
52
|
+
|
|
53
|
+
<Callout type="note">
|
|
54
|
+
The \`light-only\` and \`dark-only\` classes work on any element, not just images. You can use them on videos, iframes, or wrapper divs too.
|
|
55
|
+
</Callout>
|
|
56
|
+
|
|
57
|
+
## Videos
|
|
58
|
+
|
|
59
|
+
Videos add a dynamic element to your documentation, engaging your audience and providing a more immersive experience.
|
|
60
|
+
|
|
61
|
+
### YouTube Embed
|
|
62
|
+
|
|
63
|
+
To embed a YouTube video, use the following syntax:
|
|
64
|
+
|
|
65
|
+
\`\`\`html
|
|
66
|
+
<iframe
|
|
67
|
+
className="aspect-video"
|
|
68
|
+
src="https://www.youtube.com/embed/ResP_eVPYQo"
|
|
69
|
+
title="YouTube video player"
|
|
70
|
+
frameborder="0"
|
|
71
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
72
|
+
allowfullscreen
|
|
73
|
+
></iframe>
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
<iframe
|
|
77
|
+
className="aspect-video"
|
|
78
|
+
src="https://www.youtube.com/embed/ResP_eVPYQo"
|
|
79
|
+
title="YouTube video player"
|
|
80
|
+
frameBorder="0"
|
|
81
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
82
|
+
allowFullScreen
|
|
83
|
+
></iframe>
|
|
84
|
+
|
|
85
|
+
### Self-hosted videos
|
|
86
|
+
|
|
87
|
+
Serve up your own video content using the \`<video>\` tag:
|
|
88
|
+
|
|
89
|
+
\`\`\`html
|
|
90
|
+
<video
|
|
91
|
+
controls
|
|
92
|
+
className="aspect-video"
|
|
93
|
+
src="https://samplelib.com/lib/preview/mp4/sample-20s.mp4"
|
|
94
|
+
></video>
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
<video
|
|
98
|
+
controls
|
|
99
|
+
className="aspect-video"
|
|
100
|
+
src="https://samplelib.com/lib/preview/mp4/sample-20s.mp4"
|
|
101
|
+
|
|
102
|
+
> </video>
|
|
103
|
+
|
|
104
|
+
#### Autoplay and Looping
|
|
105
|
+
|
|
106
|
+
For demonstration videos that loop or start automatically, add attributes as shown:
|
|
107
|
+
|
|
108
|
+
\`\`\`html
|
|
109
|
+
<video
|
|
110
|
+
controls
|
|
111
|
+
className="aspect-video"
|
|
112
|
+
src="https://samplelib.com/lib/preview/mp4/sample-20s.mp4"
|
|
113
|
+
autoplay
|
|
114
|
+
muted
|
|
115
|
+
loop
|
|
116
|
+
playsinline
|
|
117
|
+
></video>
|
|
118
|
+
\`\`\``;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mermaidMdxTemplate = "---\ntitle: \"Mermaid\"\ndescription: \"Create flowcharts, sequence diagrams, and other visualizations using Mermaid syntax.\"\ndate: \"2026-07-16\"\ncategory: \"Components\"\ncategoryOrder: 1\norder:
|
|
1
|
+
export declare const mermaidMdxTemplate = "---\ntitle: \"Mermaid\"\ndescription: \"Create flowcharts, sequence diagrams, and other visualizations using Mermaid syntax.\"\ndate: \"2026-07-16\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 22\n---\n# Mermaid\n\nCreate flowcharts, sequence diagrams, and other visualizations using Mermaid syntax with automatic rendering.\n\nWrite a diagram inside a `mermaid` code fence and it renders as an SVG:\n\n````mdx\n```mermaid\nflowchart LR\n A[Start] --> B{Decision}\n B -->|Yes| C[Action]\n B -->|No| D[End]\n```\n````\n\n```mermaid\nflowchart LR\n A[Start] --> B{Decision}\n B -->|Yes| C[Action]\n B -->|No| D[End]\n```\n\nDiagrams are rendered when your site is built, so no diagramming library is shipped to your readers' browsers. They are drawn with your theme's colors and follow the light and dark toggle automatically.\n\n## Supported diagram types\n\nDoccupine renders diagrams with [beautiful-mermaid](https://github.com/lukilabs/beautiful-mermaid), which supports six diagram types:\n\n| Type | Opening keyword |\n| --- | --- |\n| Flowchart | `flowchart` or `graph` |\n| Sequence | `sequenceDiagram` |\n| State | `stateDiagram-v2` |\n| Class | `classDiagram` |\n| Entity relationship | `erDiagram` |\n| XY chart | `xychart-beta` |\n\nOther Mermaid diagram types - including `pie`, `gantt`, `mindmap`, `journey`, and `gitGraph` - are not supported. A diagram that cannot be rendered falls back to a plain code block showing its source, and the reason is logged when your site builds. A broken diagram never breaks the page.\n\n## Examples\n\n### Sequence diagram\n\n```mermaid\nsequenceDiagram\n participant Reader\n participant Docs\n participant Search\n Reader->>Docs: Open a page\n Docs->>Search: Index the content\n Search-->>Reader: Return results\n```\n\n### Subgraphs\n\n```mermaid placement=\"top-right\"\nflowchart LR\n subgraph one\n direction TB\n top1[top] --> bottom1[bottom]\n end\n subgraph two\n direction TB\n top2[top] --> bottom2[bottom]\n end\n outside --> one\n outside --> top2\n```\n\n## Interactive controls\n\nDiagrams include zoom in and out, pan in four directions, reset the view, and full screen. You can also drag a diagram with your mouse to move it around.\n\nBy default the controls appear once a diagram is taller than 120px, since a diagram that already fits does not need them. Use the `actions` property to decide explicitly. Setting `actions={false}` turns off the whole interactive layer, including dragging.\n\n## Properties\n\n<Field value=\"placement\" type=\"string\">\n Where the controls sit. One of `top-left`, `top-right`, `bottom-left`, or `bottom-right`. Defaults to `bottom-right`.\n</Field>\n\n<Field value=\"actions\" type=\"boolean\">\n Show or hide the controls. When set, this overrides the default behavior of showing them only on diagrams taller than 120px.\n</Field>\n\nSet properties on the opening fence, after the language:\n\n````mdx\n```mermaid placement=\"top-left\" actions={true}\nflowchart LR\n A --> B\n```\n````\n\nTo hide the controls entirely:\n\n````mdx\n```mermaid actions={false}\nflowchart LR\n A --> B\n```\n````\n\n```mermaid actions={false}\nflowchart LR\n A --> B\n```\n\n## Layout\n\nDiagrams are laid out with the [ELK](https://eclipse.dev/elk/) engine, which arranges nodes to reduce overlapping edges and keep large diagrams readable. It is always on, so no directive is needed to enable it.\n\nIf you are porting diagrams from another tool, a `%%{init: ...}%%` directive is read as a comment and ignored rather than causing an error.\n\n## Theming\n\nDiagram colors come from CSS variables, so they follow your theme and the light/dark toggle without re-rendering. Override any of them in your own CSS to restyle diagrams:\n\n```css\n:root {\n --mermaid-bg: var(--color-light);\n --mermaid-fg: var(--color-dark);\n --mermaid-line: var(--color-grayDark);\n --mermaid-accent: var(--color-accent);\n --mermaid-muted: var(--color-grayDark);\n --mermaid-surface: var(--color-grayLight);\n --mermaid-border: var(--color-gray);\n}\n```\n\n## Syntax reference\n\nFor the syntax of each supported diagram type, see the [Mermaid documentation](https://mermaid.js.org/intro/). Keep to the six types listed above.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const navigationMdxTemplate = "---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n# Navigation\n\nDoccupine builds your sidebar automatically from your MDX pages. By default, it reads the page frontmatter and groups pages into categories in the order you define. For larger docs, you can take full control with a `navigation.json` file.\n\n## Automatic navigation (default)\n\nWhen no custom navigation is provided, Doccupine generates a structure based on each page's frontmatter.\n\n### Frontmatter fields\n\n- **category**: The category name that groups the page in the sidebar.\n- **categoryOrder**: The position of the category within the sidebar. Lower numbers appear first.\n- **order**: The position of the page within its category. Lower numbers appear first.\n- **navIcon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the page's sidebar link.\n- **categoryIcon**: Optional Lucide icon name for the page's category header. The first page in a category that sets it wins.\n\n### Example frontmatter\n\n```text\n---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2025-01-15\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n```\n\nThis approach is great for small sets of documents. For larger projects, setting these fields on every page can become repetitive.\n\n## Custom navigation with navigation.json\n\nTo centrally define the entire sidebar, create a `navigation.json` at your project root (the same directory where you execute `npx doccupine`). When present, it takes priority over page frontmatter and fully controls the navigation structure.\n\n### Array format\n\nThe simplest format is an array of categories. When using [sections](/sections), this applies to the root section only.\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\" },\n { \"slug\": \"what-is-doccupine\", \"title\": \"What is Doccupine\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n },\n {\n \"label\": \"Components\",\n \"links\": [\n { \"slug\": \"components\", \"title\": \"Components\" },\n { \"slug\": \"headers-and-text\", \"title\": \"Headers and Text\" },\n { \"slug\": \"lists-and-tables\", \"title\": \"Lists and tables\" },\n { \"slug\": \"code\", \"title\": \"Code\" },\n { \"slug\": \"callouts\", \"title\": \"Callouts\" },\n { \"slug\": \"accordion\", \"title\": \"Accordion\" },\n { \"slug\": \"tabs\", \"title\": \"Tabs\" },\n { \"slug\": \"steps\", \"title\": \"Steps\" },\n { \"slug\": \"cards\", \"title\": \"Cards\" },\n { \"slug\": \"buttons\", \"title\": \"Buttons\" },\n { \"slug\": \"
|
|
1
|
+
export declare const navigationMdxTemplate = "---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n# Navigation\n\nDoccupine builds your sidebar automatically from your MDX pages. By default, it reads the page frontmatter and groups pages into categories in the order you define. For larger docs, you can take full control with a `navigation.json` file.\n\n## Automatic navigation (default)\n\nWhen no custom navigation is provided, Doccupine generates a structure based on each page's frontmatter.\n\n### Frontmatter fields\n\n- **category**: The category name that groups the page in the sidebar.\n- **categoryOrder**: The position of the category within the sidebar. Lower numbers appear first.\n- **order**: The position of the page within its category. Lower numbers appear first.\n- **navIcon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the page's sidebar link.\n- **categoryIcon**: Optional Lucide icon name for the page's category header. The first page in a category that sets it wins.\n\n### Example frontmatter\n\n```text\n---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2025-01-15\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n```\n\nThis approach is great for small sets of documents. For larger projects, setting these fields on every page can become repetitive.\n\n## Custom navigation with navigation.json\n\nTo centrally define the entire sidebar, create a `navigation.json` at your project root (the same directory where you execute `npx doccupine`). When present, it takes priority over page frontmatter and fully controls the navigation structure.\n\n### Array format\n\nThe simplest format is an array of categories. When using [sections](/sections), this applies to the root section only.\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\" },\n { \"slug\": \"what-is-doccupine\", \"title\": \"What is Doccupine\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n },\n {\n \"label\": \"Components\",\n \"links\": [\n { \"slug\": \"components\", \"title\": \"Components\" },\n { \"slug\": \"headers-and-text\", \"title\": \"Headers and Text\" },\n { \"slug\": \"lists-and-tables\", \"title\": \"Lists and tables\" },\n { \"slug\": \"code\", \"title\": \"Code\" },\n { \"slug\": \"prompt\", \"title\": \"Prompt\" },\n { \"slug\": \"callouts\", \"title\": \"Callouts\" },\n { \"slug\": \"accordion\", \"title\": \"Accordion\" },\n { \"slug\": \"tabs\", \"title\": \"Tabs\" },\n { \"slug\": \"steps\", \"title\": \"Steps\" },\n { \"slug\": \"tree\", \"title\": \"Tree\" },\n { \"slug\": \"cards\", \"title\": \"Cards\" },\n { \"slug\": \"buttons\", \"title\": \"Buttons\" },\n { \"slug\": \"badges\", \"title\": \"Badges\" },\n { \"slug\": \"tooltips\", \"title\": \"Tooltips\" },\n { \"slug\": \"images-and-embeds\", \"title\": \"Images and embeds\" },\n { \"slug\": \"frames\", \"title\": \"Frames\" },\n { \"slug\": \"icons\", \"title\": \"Icons\" },\n { \"slug\": \"columns\", \"title\": \"Columns\" },\n { \"slug\": \"fields\", \"title\": \"Fields\" },\n { \"slug\": \"api-playground\", \"title\": \"API Playground\" },\n { \"slug\": \"update\", \"title\": \"Update\" },\n { \"slug\": \"color-swatches\", \"title\": \"Color Swatches\" },\n { \"slug\": \"mermaid\", \"title\": \"Mermaid\" }\n ]\n },\n {\n \"label\": \"Configuration\",\n \"links\": [\n { \"slug\": \"globals\", \"title\": \"Globals\" },\n { \"slug\": \"navigation\", \"title\": \"Navigation\" },\n { \"slug\": \"sections\", \"title\": \"Sections\" },\n { \"slug\": \"footer-links\", \"title\": \"Footer Links\" },\n { \"slug\": \"theme\", \"title\": \"Theme\" },\n { \"slug\": \"fonts\", \"title\": \"Fonts\" },\n { \"slug\": \"media-and-assets\", \"title\": \"Media and assets\" }\n ]\n },\n {\n \"label\": \"AI & Integrations\",\n \"links\": [\n { \"slug\": \"ai-assistant\", \"title\": \"AI Assistant\" },\n { \"slug\": \"model-context-protocol\", \"title\": \"Model Context Protocol\" },\n { \"slug\": \"analytics\", \"title\": \"Analytics\" }\n ]\n },\n {\n \"label\": \"Deployment\",\n \"links\": [\n { \"slug\": \"deployment-and-hosting\", \"title\": \"Deployment & Hosting\" },\n { \"slug\": \"authentication\", \"title\": \"Authentication\" }\n ]\n }\n]\n```\n\n### Object format (per-section)\n\nWhen using [sections](/sections), you can define navigation for each section by using an object keyed by section slug. Sections without a key fall back to auto-generated navigation from frontmatter.\n\n```json\n{\n \"\": [\n {\n \"label\": \"General\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Getting Started\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n }\n ],\n \"platform\": [\n {\n \"label\": \"Overview\",\n \"links\": [\n { \"slug\": \"platform/auth\", \"title\": \"Authentication\" },\n { \"slug\": \"platform/users\", \"title\": \"Users\" }\n ]\n }\n ]\n}\n```\n\nThe key `\"\"` controls the root section. Other keys match section slugs defined in `sections.json` or derived from frontmatter. See [Sections](/sections) for details on configuring sections.\n\n### Fields\n\n- **label**: The section header shown in the sidebar.\n- **icon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the category header.\n- **links**: An array of page entries for that section.\n - **slug**: The MDX file slug (filename without extension). Use an empty string `\"\"` for `index.mdx`.\n - **title**: The display title in the navigation. This can differ from the page's `title` frontmatter.\n - **icon**: Optional Lucide icon name shown next to the link.\n - **links**: Optional array of nested child links. See [Nested navigation](#nested-navigation).\n\n## Icons\n\nAdd icons to categories and links to make the sidebar easier to scan. Icons use [Lucide](https://lucide.dev/icons) names in kebab-case (e.g. `rocket`, `book-open`, `settings`). Unknown names render nothing, so a typo never breaks the build.\n\nWith frontmatter, set `navIcon` on a page for its sidebar link and `categoryIcon` for its category:\n\n```text\n---\ntitle: \"Introduction\"\ncategory: \"Getting Started\"\ncategoryOrder: 1\norder: 1\nnavIcon: \"rocket\"\ncategoryIcon: \"book-open\"\n---\n```\n\nWith `navigation.json`, add an `icon` to any category or link:\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\", \"icon\": \"rocket\" },\n { \"slug\": \"commands\", \"title\": \"Commands\", \"icon\": \"terminal\" }\n ]\n }\n]\n```\n\n## Nested navigation\n\nA link in `navigation.json` can hold its own `links` array to create a collapsible group. Groups expand and collapse on click and open automatically when one of their pages is active. Nesting can go as deep as you need.\n\n```json\n[\n {\n \"label\": \"Guides\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"guides\", \"title\": \"Overview\", \"icon\": \"compass\" },\n {\n \"title\": \"Advanced\",\n \"icon\": \"settings\",\n \"links\": [\n { \"slug\": \"guides/caching\", \"title\": \"Caching\" },\n { \"slug\": \"guides/streaming\", \"title\": \"Streaming\" }\n ]\n }\n ]\n }\n]\n```\n\nA group can be a plain label - omit `slug` and it acts only as a collapsible header - or a real page, by adding a `slug` so the group title is also a link.\n\n<Callout type=\"note\">\n Nested groups are only available through `navigation.json`. Frontmatter navigation is always two levels: category and pages.\n</Callout>\n\n## Precedence and behavior\n\n<Callout type=\"note\">\n `navigation.json` takes priority over frontmatter. If present, it fully controls the sidebar structure for the sections it covers.\n</Callout>\n\n- Without `navigation.json`, the sidebar is built from page frontmatter: `category` -> grouped; `categoryOrder` -> category position; `order` -> page position.\n- When using the object format, sections not listed in `navigation.json` fall back to frontmatter-based navigation.\n- Pages without a `category` appear at the top level.\n\n## Tips\n\n- **Start simple**: Use frontmatter for small docs. Switch to `navigation.json` as the structure grows.\n- **Keep slugs consistent**: `slug` must match the MDX filename (e.g., `text.mdx` -> `text`).\n- **Control titles**: Use `title` in `navigation.json` to customize sidebar labels without changing page frontmatter.\n- **Per-section navigation**: Use the object format to define different sidebars for each section. Mix and match - define some sections explicitly and let others auto-generate.";
|
|
@@ -62,13 +62,17 @@ The simplest format is an array of categories. When using [sections](/sections),
|
|
|
62
62
|
{ "slug": "headers-and-text", "title": "Headers and Text" },
|
|
63
63
|
{ "slug": "lists-and-tables", "title": "Lists and tables" },
|
|
64
64
|
{ "slug": "code", "title": "Code" },
|
|
65
|
+
{ "slug": "prompt", "title": "Prompt" },
|
|
65
66
|
{ "slug": "callouts", "title": "Callouts" },
|
|
66
67
|
{ "slug": "accordion", "title": "Accordion" },
|
|
67
68
|
{ "slug": "tabs", "title": "Tabs" },
|
|
68
69
|
{ "slug": "steps", "title": "Steps" },
|
|
70
|
+
{ "slug": "tree", "title": "Tree" },
|
|
69
71
|
{ "slug": "cards", "title": "Cards" },
|
|
70
72
|
{ "slug": "buttons", "title": "Buttons" },
|
|
71
|
-
{ "slug": "
|
|
73
|
+
{ "slug": "badges", "title": "Badges" },
|
|
74
|
+
{ "slug": "tooltips", "title": "Tooltips" },
|
|
75
|
+
{ "slug": "images-and-embeds", "title": "Images and embeds" },
|
|
72
76
|
{ "slug": "frames", "title": "Frames" },
|
|
73
77
|
{ "slug": "icons", "title": "Icons" },
|
|
74
78
|
{ "slug": "columns", "title": "Columns" },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const promptMdxTemplate = "---\ntitle: \"Prompt\"\ndescription: \"Display re-usable AI prompts that readers can copy or open directly in Cursor.\"\ndate: \"2026-07-27\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 4\n---\n# Prompt\n\nDisplay re-usable AI prompts that readers can copy with one click or open directly in [Cursor](https://www.cursor.com).\n\n## Usage\n\nYou can use the Prompt component directly within your MDX files without any import. The body supports Markdown, and the copy button copies it as plain text with list items as dashes:\n\n```html\n<Prompt description=\"Review code for security issues.\">\nYou are a security-focused code reviewer. Examine the provided code and report any vulnerabilities.\n- Flag unsafe input handling and injection risks.\n- Suggest a safer alternative for every finding.\n- Rank findings by severity, highest first.\n</Prompt>\n```\n\n<Prompt description=\"Review code for security issues.\">\nYou are a security-focused code reviewer. Examine the provided code and report any vulnerabilities.\n- Flag unsafe input handling and injection risks.\n- Suggest a safer alternative for every finding.\n- Rank findings by severity, highest first.\n</Prompt>\n\n## Actions and icon\n\nThe `actions` property controls which buttons appear. `copy` copies the prompt to the clipboard, and `cursor` opens it in the Cursor editor through its deeplink (readers need Cursor installed). Add a [Lucide](https://lucide.dev/icons) icon next to the description with `icon`:\n\n```html\n<Prompt description=\"Draft a changelog entry.\" icon=\"sparkles\" actions={[\"copy\", \"cursor\"]}>\nYou are a release-notes assistant. Turn the merged pull requests I paste into a changelog entry.\n- Group changes under Added, Changed, and Fixed.\n- Write one plain-language line per change.\n- Link each line to its pull request number.\n</Prompt>\n```\n\n<Prompt description=\"Draft a changelog entry.\" icon=\"sparkles\" actions={[\"copy\", \"cursor\"]}>\nYou are a release-notes assistant. Turn the merged pull requests I paste into a changelog entry.\n- Group changes under Added, Changed, and Fixed.\n- Write one plain-language line per change.\n- Link each line to its pull request number.\n</Prompt>\n\n## Properties\n\n<Field value=\"description\" type=\"string\" required>\n The text displayed in the card header above the prompt.\n</Field>\n\n<Field value=\"children\" type=\"node\" required>\n The prompt itself. Rendered as Markdown in the card and converted to plain text for the copy and Cursor actions.\n</Field>\n\n<Field value=\"actions\" type=\"array\">\n Which action buttons to show. Valid values are `\"copy\"` and `\"cursor\"`. Defaults to `[\"copy\"]`.\n</Field>\n\n<Field value=\"icon\" type=\"string\">\n A [Lucide](https://lucide.dev/icons) icon name in kebab-case, displayed before the description.\n</Field>";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const promptMdxTemplate = `---
|
|
2
|
+
title: "Prompt"
|
|
3
|
+
description: "Display re-usable AI prompts that readers can copy or open directly in Cursor."
|
|
4
|
+
date: "2026-07-27"
|
|
5
|
+
category: "Components"
|
|
6
|
+
categoryOrder: 1
|
|
7
|
+
order: 4
|
|
8
|
+
---
|
|
9
|
+
# Prompt
|
|
10
|
+
|
|
11
|
+
Display re-usable AI prompts that readers can copy with one click or open directly in [Cursor](https://www.cursor.com).
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
You can use the Prompt component directly within your MDX files without any import. The body supports Markdown, and the copy button copies it as plain text with list items as dashes:
|
|
16
|
+
|
|
17
|
+
\`\`\`html
|
|
18
|
+
<Prompt description="Review code for security issues.">
|
|
19
|
+
You are a security-focused code reviewer. Examine the provided code and report any vulnerabilities.
|
|
20
|
+
- Flag unsafe input handling and injection risks.
|
|
21
|
+
- Suggest a safer alternative for every finding.
|
|
22
|
+
- Rank findings by severity, highest first.
|
|
23
|
+
</Prompt>
|
|
24
|
+
\`\`\`
|
|
25
|
+
|
|
26
|
+
<Prompt description="Review code for security issues.">
|
|
27
|
+
You are a security-focused code reviewer. Examine the provided code and report any vulnerabilities.
|
|
28
|
+
- Flag unsafe input handling and injection risks.
|
|
29
|
+
- Suggest a safer alternative for every finding.
|
|
30
|
+
- Rank findings by severity, highest first.
|
|
31
|
+
</Prompt>
|
|
32
|
+
|
|
33
|
+
## Actions and icon
|
|
34
|
+
|
|
35
|
+
The \`actions\` property controls which buttons appear. \`copy\` copies the prompt to the clipboard, and \`cursor\` opens it in the Cursor editor through its deeplink (readers need Cursor installed). Add a [Lucide](https://lucide.dev/icons) icon next to the description with \`icon\`:
|
|
36
|
+
|
|
37
|
+
\`\`\`html
|
|
38
|
+
<Prompt description="Draft a changelog entry." icon="sparkles" actions={["copy", "cursor"]}>
|
|
39
|
+
You are a release-notes assistant. Turn the merged pull requests I paste into a changelog entry.
|
|
40
|
+
- Group changes under Added, Changed, and Fixed.
|
|
41
|
+
- Write one plain-language line per change.
|
|
42
|
+
- Link each line to its pull request number.
|
|
43
|
+
</Prompt>
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
<Prompt description="Draft a changelog entry." icon="sparkles" actions={["copy", "cursor"]}>
|
|
47
|
+
You are a release-notes assistant. Turn the merged pull requests I paste into a changelog entry.
|
|
48
|
+
- Group changes under Added, Changed, and Fixed.
|
|
49
|
+
- Write one plain-language line per change.
|
|
50
|
+
- Link each line to its pull request number.
|
|
51
|
+
</Prompt>
|
|
52
|
+
|
|
53
|
+
## Properties
|
|
54
|
+
|
|
55
|
+
<Field value="description" type="string" required>
|
|
56
|
+
The text displayed in the card header above the prompt.
|
|
57
|
+
</Field>
|
|
58
|
+
|
|
59
|
+
<Field value="children" type="node" required>
|
|
60
|
+
The prompt itself. Rendered as Markdown in the card and converted to plain text for the copy and Cursor actions.
|
|
61
|
+
</Field>
|
|
62
|
+
|
|
63
|
+
<Field value="actions" type="array">
|
|
64
|
+
Which action buttons to show. Valid values are \`"copy"\` and \`"cursor"\`. Defaults to \`["copy"]\`.
|
|
65
|
+
</Field>
|
|
66
|
+
|
|
67
|
+
<Field value="icon" type="string">
|
|
68
|
+
A [Lucide](https://lucide.dev/icons) icon name in kebab-case, displayed before the description.
|
|
69
|
+
</Field>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const stepsMdxTemplate = "---\ntitle: \"Steps\"\ndescription: \"Guide readers step-by-step using the Steps component.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder:
|
|
1
|
+
export declare const stepsMdxTemplate = "---\ntitle: \"Steps\"\ndescription: \"Guide readers step-by-step using the Steps component.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 8\n---\n# Steps\n\nGuide readers step-by-step using the Steps component.\n\nThe Steps component is perfect for organizing procedures or workflows in a clear sequence. Include as many individual steps as necessary to outline your process.\n\n## Steps Usage\n\nYou can use the `Steps` component to create a step-by-step guide. Each step is represented by a `Step` component, which includes a title and content.\n\n```html\n<Steps>\n <Step title=\"Step 1\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Step>\n <Step title=\"Step 2\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Step>\n <Step title=\"Step 3\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Step>\n</Steps>\n```\n\n<Steps>\n <Step title=\"Step 1\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Step>\n <Step title=\"Step 2\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Step>\n <Step title=\"Step 3\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Step>\n</Steps>\n\n## Properties\n\n<Field value=\"title\" type=\"string\">\n An optional title for the step. When omitted, the step renders without a title row.\n</Field>\n\n<Field value=\"icon\" type=\"string\">\n A [Lucide](https://lucide.dev/icons) icon name shown next to the step title.\n</Field>\n\n<Field value=\"children\" type=\"node\" required>\n The content of the step.\n</Field>";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tabsMdxTemplate = "---\ntitle: \"Tabs\"\ndescription: \"Use the Tabs component to display different content sections in a switchable panel layout.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder:
|
|
1
|
+
export declare const tabsMdxTemplate = "---\ntitle: \"Tabs\"\ndescription: \"Use the Tabs component to display different content sections in a switchable panel layout.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 7\n---\n# Tabs\n\nUse the Tabs component to display different content sections in a switchable panel layout.\n\nTabs are useful for grouping related information while keeping the interface tidy. You can create as many tabs as needed, and each one can hold other components, text, or code snippets.\n\n## Tabs Usage\n\nYou can use the Tabs component directly within your MDX files without any import. The following example shows a basic usage:\n\n````html\n<Tabs>\n <TabContent title=\"First tab\" icon=\"code\">\n \u261D\uFE0F This is the content shown only when the first tab is active.\n\n Tabs can include all kinds of components. For example, a simple Java program:\n ```java\n class HelloWorld {\n public static void main(String[] args) {\n System.out.println(\"Hello, World!\");\n }\n }\n ```\n </TabContent>\n <TabContent title=\"Second tab\" icon=\"book-open\">\n \u270C\uFE0F Content inside this second tab is separate from the first.\n </TabContent>\n <TabContent title=\"Third tab\" icon=\"rocket\">\n \uD83D\uDCAA This third tab contains its own unique content.\n </TabContent>\n</Tabs>\n````\n\n<Tabs>\n <TabContent title=\"First tab\" icon=\"code\">\n \u261D\uFE0F This is the content shown only when the first tab is active.\n\n Tabs can include all kinds of components. For example, a simple Java program:\n ```java\n class HelloWorld {\n public static void main(String[] args) {\n System.out.println(\"Hello, World!\");\n }\n }\n ```\n </TabContent>\n <TabContent title=\"Second tab\" icon=\"book-open\">\n \u270C\uFE0F Content inside this second tab is separate from the first.\n </TabContent>\n <TabContent title=\"Third tab\" icon=\"rocket\">\n \uD83D\uDCAA This third tab contains its own unique content.\n </TabContent>\n</Tabs>\n\nEach tab also accepts an optional `icon` - any [Lucide](https://lucide.dev/icons) icon name - rendered before its title, as shown above.\n\n## Properties\n\n<Field value=\"title\" type=\"string\">\n The title of the tab.\n</Field>\n\n<Field value=\"icon\" type=\"string\">\n Optional [Lucide](https://lucide.dev/icons) icon name (kebab-case, e.g.\n `rocket`) shown next to the tab title.\n</Field>\n\n<Field value=\"children\" type=\"node\" required>\n The content of the tabs.\n</Field>";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tooltipsMdxTemplate = "---\ntitle: \"Tooltips\"\ndescription: \"Show contextual definitions and explanations when readers hover over a term.\"\ndate: \"2026-07-27\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 13\n---\n# Tooltips\n\nShow contextual definitions and explanations when readers hover over terms, abbreviations, or technical concepts.\n\nThe `Tooltip` component wraps a string of text and reveals a small bubble of additional context on hover or keyboard focus. Tooltips can include an optional headline and a call-to-action link.\n\nTooltips stay inside the viewport: when the wrapped term sits near a screen edge the bubble shifts to fit, and when there is no room above it flips below the term. On touch screens, tap the term to open the tooltip and tap anywhere else to dismiss it.\n\n## Usage\n\nYou can use the Tooltip component directly within your MDX files without any import:\n\n```html\nEvery <Tooltip tip=\"Application Programming Interface: a set of protocols that lets software applications communicate.\">API</Tooltip> endpoint is documented on its own page.\n```\n\nEvery <Tooltip tip=\"Application Programming Interface: a set of protocols that lets software applications communicate.\">API</Tooltip> endpoint is documented on its own page.\n\n## Headline and call to action\n\nAdd a bold headline above the tip text with `headline`, and append a link with `cta` and `href`. Internal links open in the same tab; external links open in a new one.\n\n```html\nTry the <Tooltip headline=\"API Playground\" tip=\"An interactive API reference where readers send real requests and inspect live responses.\" cta=\"Open the API Playground guide\" href=\"/api-playground\">interactive playground</Tooltip> to explore your endpoints.\n```\n\nTry the <Tooltip headline=\"API Playground\" tip=\"An interactive API reference where readers send real requests and inspect live responses.\" cta=\"Open the API Playground guide\" href=\"/api-playground\">interactive playground</Tooltip> to explore your endpoints.\n\n## Properties\n\n<Field value=\"tip\" type=\"string\" required>\n The text displayed in the tooltip.\n</Field>\n\n<Field value=\"headline\" type=\"string\">\n Bold text displayed above the tip text.\n</Field>\n\n<Field value=\"cta\" type=\"string\">\n The call-to-action text for a link inside the tooltip.\n</Field>\n\n<Field value=\"href\" type=\"string\">\n URL for the call-to-action link. Required when using `cta`.\n</Field>\n\n<Field value=\"children\" type=\"node\" required>\n The text that triggers the tooltip on hover or focus.\n</Field>";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const tooltipsMdxTemplate = `---
|
|
2
|
+
title: "Tooltips"
|
|
3
|
+
description: "Show contextual definitions and explanations when readers hover over a term."
|
|
4
|
+
date: "2026-07-27"
|
|
5
|
+
category: "Components"
|
|
6
|
+
categoryOrder: 1
|
|
7
|
+
order: 13
|
|
8
|
+
---
|
|
9
|
+
# Tooltips
|
|
10
|
+
|
|
11
|
+
Show contextual definitions and explanations when readers hover over terms, abbreviations, or technical concepts.
|
|
12
|
+
|
|
13
|
+
The \`Tooltip\` component wraps a string of text and reveals a small bubble of additional context on hover or keyboard focus. Tooltips can include an optional headline and a call-to-action link.
|
|
14
|
+
|
|
15
|
+
Tooltips stay inside the viewport: when the wrapped term sits near a screen edge the bubble shifts to fit, and when there is no room above it flips below the term. On touch screens, tap the term to open the tooltip and tap anywhere else to dismiss it.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
You can use the Tooltip component directly within your MDX files without any import:
|
|
20
|
+
|
|
21
|
+
\`\`\`html
|
|
22
|
+
Every <Tooltip tip="Application Programming Interface: a set of protocols that lets software applications communicate.">API</Tooltip> endpoint is documented on its own page.
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
Every <Tooltip tip="Application Programming Interface: a set of protocols that lets software applications communicate.">API</Tooltip> endpoint is documented on its own page.
|
|
26
|
+
|
|
27
|
+
## Headline and call to action
|
|
28
|
+
|
|
29
|
+
Add a bold headline above the tip text with \`headline\`, and append a link with \`cta\` and \`href\`. Internal links open in the same tab; external links open in a new one.
|
|
30
|
+
|
|
31
|
+
\`\`\`html
|
|
32
|
+
Try the <Tooltip headline="API Playground" tip="An interactive API reference where readers send real requests and inspect live responses." cta="Open the API Playground guide" href="/api-playground">interactive playground</Tooltip> to explore your endpoints.
|
|
33
|
+
\`\`\`
|
|
34
|
+
|
|
35
|
+
Try the <Tooltip headline="API Playground" tip="An interactive API reference where readers send real requests and inspect live responses." cta="Open the API Playground guide" href="/api-playground">interactive playground</Tooltip> to explore your endpoints.
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
<Field value="tip" type="string" required>
|
|
40
|
+
The text displayed in the tooltip.
|
|
41
|
+
</Field>
|
|
42
|
+
|
|
43
|
+
<Field value="headline" type="string">
|
|
44
|
+
Bold text displayed above the tip text.
|
|
45
|
+
</Field>
|
|
46
|
+
|
|
47
|
+
<Field value="cta" type="string">
|
|
48
|
+
The call-to-action text for a link inside the tooltip.
|
|
49
|
+
</Field>
|
|
50
|
+
|
|
51
|
+
<Field value="href" type="string">
|
|
52
|
+
URL for the call-to-action link. Required when using \`cta\`.
|
|
53
|
+
</Field>
|
|
54
|
+
|
|
55
|
+
<Field value="children" type="node" required>
|
|
56
|
+
The text that triggers the tooltip on hover or focus.
|
|
57
|
+
</Field>`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const treeMdxTemplate = "---\ntitle: \"Tree\"\ndescription: \"Display hierarchical file and folder structures with collapsible nodes.\"\ndate: \"2026-07-27\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 9\n---\n# Tree\n\nDisplay hierarchical structures like file systems, project directories, or nested content. The tree component supports full keyboard navigation and accessibility features.\n\nCreate trees with either a Markdown list or the `Tree.Folder` and `Tree.File` components. `<Tree>` and `<FileTree>` are aliases, so either tag works with either syntax.\n\nUse the Markdown list syntax for quick, static trees where every folder with content expands by default. Use the component syntax when you need to control open state per folder with `defaultOpen`, mark folders as non-interactive with `openable`, or mix files and folders at arbitrary depth.\n\n## Markdown list syntax\n\nWrite a nested Markdown list inside `<FileTree>` (or `<Tree>`) to describe a folder structure. Add a trailing slash to mark a folder, or nest items under it. Folders that contain nested items expand by default.\n\n<FileTree>\n\n- docs/\n - index.mdx\n - guides/\n - configuration.mdx\n- docs.config.ts\n\n</FileTree>\n\n```mdx\n<FileTree>\n\n- docs/\n - index.mdx\n - guides/\n - configuration.mdx\n- docs.config.ts\n\n</FileTree>\n```\n\n<Callout type=\"note\">\n Leave a blank line after the opening tag and before the closing tag so the list parses as Markdown. Names strip inline formatting like `code`, **bold**, or _italic_.\n</Callout>\n\n## Basic tree\n\nBuild trees with the `Tree.Folder` and `Tree.File` components when you want per-folder control. Folders start closed unless you set `defaultOpen`.\n\n<Tree>\n <Tree.Folder name=\"app\" defaultOpen>\n <Tree.File name=\"layout.tsx\" />\n <Tree.File name=\"page.tsx\" />\n <Tree.File name=\"global.css\" />\n </Tree.Folder>\n <Tree.Folder name=\"lib\">\n <Tree.File name=\"utils.ts\" />\n <Tree.File name=\"db.ts\" />\n </Tree.Folder>\n <Tree.File name=\"package.json\" />\n <Tree.File name=\"tsconfig.json\" />\n</Tree>\n\n```mdx\n<Tree>\n <Tree.Folder name=\"app\" defaultOpen>\n <Tree.File name=\"layout.tsx\" />\n <Tree.File name=\"page.tsx\" />\n <Tree.File name=\"global.css\" />\n </Tree.Folder>\n <Tree.Folder name=\"lib\">\n <Tree.File name=\"utils.ts\" />\n <Tree.File name=\"db.ts\" />\n </Tree.Folder>\n <Tree.File name=\"package.json\" />\n <Tree.File name=\"tsconfig.json\" />\n</Tree>\n```\n\n## Nested folders\n\nCreate deeply nested structures by nesting `Tree.Folder` components within each other.\n\n<Tree>\n <Tree.Folder name=\"app\" defaultOpen>\n <Tree.File name=\"layout.tsx\" />\n <Tree.File name=\"page.tsx\" />\n <Tree.Folder name=\"api\" defaultOpen>\n <Tree.Folder name=\"auth\">\n <Tree.File name=\"route.ts\" />\n </Tree.Folder>\n <Tree.File name=\"route.ts\" />\n </Tree.Folder>\n <Tree.Folder name=\"components\">\n <Tree.File name=\"button.tsx\" />\n <Tree.File name=\"dialog.tsx\" />\n <Tree.File name=\"tabs.tsx\" />\n </Tree.Folder>\n </Tree.Folder>\n <Tree.File name=\"package.json\" />\n</Tree>\n\n```mdx\n<Tree>\n <Tree.Folder name=\"app\" defaultOpen>\n <Tree.File name=\"layout.tsx\" />\n <Tree.File name=\"page.tsx\" />\n <Tree.Folder name=\"api\" defaultOpen>\n <Tree.Folder name=\"auth\">\n <Tree.File name=\"route.ts\" />\n </Tree.Folder>\n <Tree.File name=\"route.ts\" />\n </Tree.Folder>\n <Tree.Folder name=\"components\">\n <Tree.File name=\"button.tsx\" />\n <Tree.File name=\"dialog.tsx\" />\n <Tree.File name=\"tabs.tsx\" />\n </Tree.Folder>\n </Tree.Folder>\n <Tree.File name=\"package.json\" />\n</Tree>\n```\n\n## Keyboard navigation\n\nClick a tree to focus it, then navigate with the keyboard:\n\n- **Arrow up/down**: Move through visible items.\n- **Arrow right**: Expand a closed folder, or move to the first child of an open folder.\n- **Arrow left**: Collapse an open folder, or move to the parent folder.\n- **Home**: Jump to the first item in the tree.\n- **End**: Jump to the last visible item in the tree.\n- **Enter/Space**: Toggle a folder open or closed.\n- **Asterisk**: Expand all sibling folders at the current level.\n- **Type-ahead search**: Type characters to jump to the next item that starts with them.\n\n## Properties\n\n### Tree.Folder\n\n<Field value=\"name\" type=\"string\" required>\n The name of the folder displayed in the tree.\n</Field>\n\n<Field value=\"defaultOpen\" type=\"boolean\">\n Whether the folder expands by default. Defaults to `false`.\n</Field>\n\n<Field value=\"openable\" type=\"boolean\">\n Whether readers can open and close the folder. Set to `false` for a non-interactive folder that stays in its `defaultOpen` state. Defaults to `true`.\n</Field>\n\n### Tree.File\n\n<Field value=\"name\" type=\"string\" required>\n The name of the file displayed in the tree.\n</Field>";
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export const treeMdxTemplate = `---
|
|
2
|
+
title: "Tree"
|
|
3
|
+
description: "Display hierarchical file and folder structures with collapsible nodes."
|
|
4
|
+
date: "2026-07-27"
|
|
5
|
+
category: "Components"
|
|
6
|
+
categoryOrder: 1
|
|
7
|
+
order: 9
|
|
8
|
+
---
|
|
9
|
+
# Tree
|
|
10
|
+
|
|
11
|
+
Display hierarchical structures like file systems, project directories, or nested content. The tree component supports full keyboard navigation and accessibility features.
|
|
12
|
+
|
|
13
|
+
Create trees with either a Markdown list or the \`Tree.Folder\` and \`Tree.File\` components. \`<Tree>\` and \`<FileTree>\` are aliases, so either tag works with either syntax.
|
|
14
|
+
|
|
15
|
+
Use the Markdown list syntax for quick, static trees where every folder with content expands by default. Use the component syntax when you need to control open state per folder with \`defaultOpen\`, mark folders as non-interactive with \`openable\`, or mix files and folders at arbitrary depth.
|
|
16
|
+
|
|
17
|
+
## Markdown list syntax
|
|
18
|
+
|
|
19
|
+
Write a nested Markdown list inside \`<FileTree>\` (or \`<Tree>\`) to describe a folder structure. Add a trailing slash to mark a folder, or nest items under it. Folders that contain nested items expand by default.
|
|
20
|
+
|
|
21
|
+
<FileTree>
|
|
22
|
+
|
|
23
|
+
- docs/
|
|
24
|
+
- index.mdx
|
|
25
|
+
- guides/
|
|
26
|
+
- configuration.mdx
|
|
27
|
+
- docs.config.ts
|
|
28
|
+
|
|
29
|
+
</FileTree>
|
|
30
|
+
|
|
31
|
+
\`\`\`mdx
|
|
32
|
+
<FileTree>
|
|
33
|
+
|
|
34
|
+
- docs/
|
|
35
|
+
- index.mdx
|
|
36
|
+
- guides/
|
|
37
|
+
- configuration.mdx
|
|
38
|
+
- docs.config.ts
|
|
39
|
+
|
|
40
|
+
</FileTree>
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
<Callout type="note">
|
|
44
|
+
Leave a blank line after the opening tag and before the closing tag so the list parses as Markdown. Names strip inline formatting like \`code\`, **bold**, or _italic_.
|
|
45
|
+
</Callout>
|
|
46
|
+
|
|
47
|
+
## Basic tree
|
|
48
|
+
|
|
49
|
+
Build trees with the \`Tree.Folder\` and \`Tree.File\` components when you want per-folder control. Folders start closed unless you set \`defaultOpen\`.
|
|
50
|
+
|
|
51
|
+
<Tree>
|
|
52
|
+
<Tree.Folder name="app" defaultOpen>
|
|
53
|
+
<Tree.File name="layout.tsx" />
|
|
54
|
+
<Tree.File name="page.tsx" />
|
|
55
|
+
<Tree.File name="global.css" />
|
|
56
|
+
</Tree.Folder>
|
|
57
|
+
<Tree.Folder name="lib">
|
|
58
|
+
<Tree.File name="utils.ts" />
|
|
59
|
+
<Tree.File name="db.ts" />
|
|
60
|
+
</Tree.Folder>
|
|
61
|
+
<Tree.File name="package.json" />
|
|
62
|
+
<Tree.File name="tsconfig.json" />
|
|
63
|
+
</Tree>
|
|
64
|
+
|
|
65
|
+
\`\`\`mdx
|
|
66
|
+
<Tree>
|
|
67
|
+
<Tree.Folder name="app" defaultOpen>
|
|
68
|
+
<Tree.File name="layout.tsx" />
|
|
69
|
+
<Tree.File name="page.tsx" />
|
|
70
|
+
<Tree.File name="global.css" />
|
|
71
|
+
</Tree.Folder>
|
|
72
|
+
<Tree.Folder name="lib">
|
|
73
|
+
<Tree.File name="utils.ts" />
|
|
74
|
+
<Tree.File name="db.ts" />
|
|
75
|
+
</Tree.Folder>
|
|
76
|
+
<Tree.File name="package.json" />
|
|
77
|
+
<Tree.File name="tsconfig.json" />
|
|
78
|
+
</Tree>
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
## Nested folders
|
|
82
|
+
|
|
83
|
+
Create deeply nested structures by nesting \`Tree.Folder\` components within each other.
|
|
84
|
+
|
|
85
|
+
<Tree>
|
|
86
|
+
<Tree.Folder name="app" defaultOpen>
|
|
87
|
+
<Tree.File name="layout.tsx" />
|
|
88
|
+
<Tree.File name="page.tsx" />
|
|
89
|
+
<Tree.Folder name="api" defaultOpen>
|
|
90
|
+
<Tree.Folder name="auth">
|
|
91
|
+
<Tree.File name="route.ts" />
|
|
92
|
+
</Tree.Folder>
|
|
93
|
+
<Tree.File name="route.ts" />
|
|
94
|
+
</Tree.Folder>
|
|
95
|
+
<Tree.Folder name="components">
|
|
96
|
+
<Tree.File name="button.tsx" />
|
|
97
|
+
<Tree.File name="dialog.tsx" />
|
|
98
|
+
<Tree.File name="tabs.tsx" />
|
|
99
|
+
</Tree.Folder>
|
|
100
|
+
</Tree.Folder>
|
|
101
|
+
<Tree.File name="package.json" />
|
|
102
|
+
</Tree>
|
|
103
|
+
|
|
104
|
+
\`\`\`mdx
|
|
105
|
+
<Tree>
|
|
106
|
+
<Tree.Folder name="app" defaultOpen>
|
|
107
|
+
<Tree.File name="layout.tsx" />
|
|
108
|
+
<Tree.File name="page.tsx" />
|
|
109
|
+
<Tree.Folder name="api" defaultOpen>
|
|
110
|
+
<Tree.Folder name="auth">
|
|
111
|
+
<Tree.File name="route.ts" />
|
|
112
|
+
</Tree.Folder>
|
|
113
|
+
<Tree.File name="route.ts" />
|
|
114
|
+
</Tree.Folder>
|
|
115
|
+
<Tree.Folder name="components">
|
|
116
|
+
<Tree.File name="button.tsx" />
|
|
117
|
+
<Tree.File name="dialog.tsx" />
|
|
118
|
+
<Tree.File name="tabs.tsx" />
|
|
119
|
+
</Tree.Folder>
|
|
120
|
+
</Tree.Folder>
|
|
121
|
+
<Tree.File name="package.json" />
|
|
122
|
+
</Tree>
|
|
123
|
+
\`\`\`
|
|
124
|
+
|
|
125
|
+
## Keyboard navigation
|
|
126
|
+
|
|
127
|
+
Click a tree to focus it, then navigate with the keyboard:
|
|
128
|
+
|
|
129
|
+
- **Arrow up/down**: Move through visible items.
|
|
130
|
+
- **Arrow right**: Expand a closed folder, or move to the first child of an open folder.
|
|
131
|
+
- **Arrow left**: Collapse an open folder, or move to the parent folder.
|
|
132
|
+
- **Home**: Jump to the first item in the tree.
|
|
133
|
+
- **End**: Jump to the last visible item in the tree.
|
|
134
|
+
- **Enter/Space**: Toggle a folder open or closed.
|
|
135
|
+
- **Asterisk**: Expand all sibling folders at the current level.
|
|
136
|
+
- **Type-ahead search**: Type characters to jump to the next item that starts with them.
|
|
137
|
+
|
|
138
|
+
## Properties
|
|
139
|
+
|
|
140
|
+
### Tree.Folder
|
|
141
|
+
|
|
142
|
+
<Field value="name" type="string" required>
|
|
143
|
+
The name of the folder displayed in the tree.
|
|
144
|
+
</Field>
|
|
145
|
+
|
|
146
|
+
<Field value="defaultOpen" type="boolean">
|
|
147
|
+
Whether the folder expands by default. Defaults to \`false\`.
|
|
148
|
+
</Field>
|
|
149
|
+
|
|
150
|
+
<Field value="openable" type="boolean">
|
|
151
|
+
Whether readers can open and close the folder. Set to \`false\` for a non-interactive folder that stays in its \`defaultOpen\` state. Defaults to \`true\`.
|
|
152
|
+
</Field>
|
|
153
|
+
|
|
154
|
+
### Tree.File
|
|
155
|
+
|
|
156
|
+
<Field value="name" type="string" required>
|
|
157
|
+
The name of the file displayed in the tree.
|
|
158
|
+
</Field>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const updateMdxTemplate = "---\ntitle: \"Update\"\ndescription: \"Easily manage and present change history.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder:
|
|
1
|
+
export declare const updateMdxTemplate = "---\ntitle: \"Update\"\ndescription: \"Easily manage and present change history.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 20\nrss: true\n---\n# Update\n\nEasily manage and present change history.\n\nThe `Update` component helps you display release notes, version details, and changelogs in a standardized format.\n\nEach `Update` label is added to the \"On this page\" sidebar and gets its own anchor, so you can link directly to a specific entry.\n\n<Update label=\"v0.0.1\" description=\"Example\">\n ## Example entry\n\n You can include anything here - images, code snippets, or a bullet list of modifications.\n\n \n\n ### Key additions\n\n - Fully responsive layout\n - Individual anchor for each update\n - Automatic RSS feed entry generation\n</Update>\n\n## Update Usage\n\nYou can combine multiple `Update` components to build complete changelogs.\n\n```html\n<Update label=\"v0.0.1\" description=\"Example\">\n ## Example entry\n\n You can include anything here - images, code snippets, or a bullet list of modifications.\n\n \n\n ### Key additions\n\n - Fully responsive layout\n - Individual anchor for each update\n - Automatic RSS feed entry generation\n</Update>\n```\n\n## Subscribable changelogs\n\nEvery page that contains at least one `Update` component automatically publishes an RSS feed at its page URL with `/rss.xml` appended. For example, this page's feed lives at `/update/rss.xml`.\n\nEach `Update` becomes a feed entry: the `label` is the entry title, and the entry link deep-links to the update's anchor on the page. New entries reach subscribers as soon as the site is rebuilt with new `Update` components.\n\nFeed entries contain pure Markdown only. They exclude components, code, and HTML elements. Use the `rss` property to provide alternative text for feed readers when an update consists mostly of excluded content:\n\n```html\n<Update label=\"v0.0.2\" rss=\"Added dark mode and fixed sidebar links.\">\n <Frame></Frame>\n</Update>\n```\n\nThe feed's channel title and description come from the page frontmatter, falling back to the site name and description from `config.json`. RSS feeds are only available on public documentation - password-protected sites do not expose them.\n\nRSS feeds can integrate with Slack, email, or other subscription tools to notify readers of changes. Some options include:\n\n- [Slack](https://slack.com/help/articles/218688467-Add-RSS-feeds-to-Slack)\n- [Email](https://zapier.com/apps/email/integrations/rss/1441/send-new-rss-feed-entries-via-email) via Zapier\n- Discord bots like [Readybot](https://readybot.io)\n\n## RSS button\n\nTo make the feed discoverable, add `rss: true` to the page frontmatter. This displays an RSS button at the top of the page that links to the feed - this page shows one. The button only appears when the page actually contains `Update` components.\n\n```yaml\n---\nrss: true\n---\n```\n\n## Properties\n\n<Field value=\"label\" type=\"string\" required>\n The label of the update. It also appears in the page's \"On this page\"\n navigation, acts as a deep-link anchor to this entry, and becomes the entry\n title in the page's RSS feed.\n</Field>\n\n<Field value=\"description\" type=\"string\">\n An optional description for the update. When omitted, no description is shown.\n</Field>\n\n<Field value=\"rss\" type=\"string\">\n Alternative pure-Markdown text for this entry in the page's RSS feed. When\n omitted, the feed uses the entry content with components, code, and HTML\n removed. Never rendered on the page.\n</Field>\n\n<Field value=\"children\" type=\"node\" required>\n The content of the update.\n</Field>";
|