|
| 1 | +# MDC Components Reference |
| 2 | + |
| 3 | +Docus uses Nuxt UI components with MDC syntax. |
| 4 | + |
| 5 | +**CRITICAL: Always use the `u-` prefix for Nuxt UI components in MDC:** |
| 6 | + |
| 7 | +```markdown |
| 8 | +::u-page-hero ✅ Correct (resolves to UPageHero) |
| 9 | +::page-hero ❌ Wrong (fails to resolve) |
| 10 | +``` |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Documentation Sources |
| 15 | + |
| 16 | +**Components:** |
| 17 | +- Component list: https://ui.nuxt.com/llms.txt |
| 18 | +- Raw docs: `https://ui.nuxt.com/raw/docs/components/[component].md` |
| 19 | + |
| 20 | +**Typography/Prose:** |
| 21 | +- Introduction: https://ui.nuxt.com/raw/docs/typography.md |
| 22 | +- Headers and text: https://ui.nuxt.com/raw/docs/typography/headers-and-text.md |
| 23 | +- Lists and tables: https://ui.nuxt.com/raw/docs/typography/lists-and-tables.md |
| 24 | +- Code blocks: https://ui.nuxt.com/raw/docs/typography/code-blocks.md |
| 25 | +- Callouts: https://ui.nuxt.com/raw/docs/typography/callouts.md |
| 26 | +- Accordion: https://ui.nuxt.com/raw/docs/typography/accordion.md |
| 27 | +- Tabs: https://ui.nuxt.com/raw/docs/typography/tabs.md |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Page Layout Components |
| 32 | + |
| 33 | +Most used components for documentation sites: |
| 34 | + |
| 35 | +| Component | Raw Docs | Use For | |
| 36 | +|-----------|----------|---------| |
| 37 | +| `u-page-hero` | [page-hero.md](https://ui.nuxt.com/raw/docs/components/page-hero.md) | Landing page hero | |
| 38 | +| `u-page-section` | [page-section.md](https://ui.nuxt.com/raw/docs/components/page-section.md) | Content sections | |
| 39 | +| `u-page-grid` | [page-grid.md](https://ui.nuxt.com/raw/docs/components/page-grid.md) | Responsive grid layout | |
| 40 | +| `u-page-card` | [page-card.md](https://ui.nuxt.com/raw/docs/components/page-card.md) | Rich content cards | |
| 41 | +| `u-page-feature` | [page-feature.md](https://ui.nuxt.com/raw/docs/components/page-feature.md) | Feature showcase | |
| 42 | +| `u-page-cta` | [page-cta.md](https://ui.nuxt.com/raw/docs/components/page-cta.md) | Call to action | |
| 43 | +| `u-page-header` | [page-header.md](https://ui.nuxt.com/raw/docs/components/page-header.md) | Page headers | |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +## Quick Syntax Examples |
| 48 | + |
| 49 | +### Hero with Buttons |
| 50 | + |
| 51 | +```markdown |
| 52 | +::u-page-hero |
| 53 | +#title |
| 54 | +Project Name |
| 55 | + |
| 56 | +#description |
| 57 | +Short description |
| 58 | + |
| 59 | +#headline |
| 60 | + :::u-button{size="sm" to="/changelog" variant="outline"} |
| 61 | + v1.0.0 → |
| 62 | + ::: |
| 63 | + |
| 64 | +#links |
| 65 | + :::u-button{color="neutral" size="xl" to="/getting-started" trailing-icon="i-lucide-arrow-right"} |
| 66 | + Get Started |
| 67 | + ::: |
| 68 | + |
| 69 | + :::u-button{color="neutral" size="xl" to="https://github.com/..." target="_blank" variant="outline" icon="i-simple-icons-github"} |
| 70 | + GitHub |
| 71 | + ::: |
| 72 | +:: |
| 73 | +``` |
| 74 | +
|
| 75 | +### Grid with Cards |
| 76 | +
|
| 77 | +```markdown |
| 78 | +::u-page-section |
| 79 | + :::u-page-grid |
| 80 | + ::::u-page-card{spotlight class="col-span-2 lg:col-span-1" to="/feature"} |
| 81 | + #title |
| 82 | + Feature Title |
| 83 | +
|
| 84 | + #description |
| 85 | + Feature description |
| 86 | + :::: |
| 87 | +
|
| 88 | + ::::u-page-card{spotlight class="col-span-2"} |
| 89 | + :::::u-color-mode-image{alt="Screenshot" class="w-full rounded-lg" dark="/images/dark.png" light="/images/light.png"} |
| 90 | + ::::: |
| 91 | +
|
| 92 | + #title |
| 93 | + Visual Feature |
| 94 | +
|
| 95 | + #description |
| 96 | + With light/dark mode images |
| 97 | + :::: |
| 98 | + ::: |
| 99 | +:: |
| 100 | +``` |
| 101 | + |
| 102 | +### Card with Code Block |
| 103 | + |
| 104 | +```markdown |
| 105 | +::::u-page-card{spotlight class="col-span-2 md:col-span-1"} |
| 106 | + :::::div{.bg-elevated.rounded-lg.p-3} |
| 107 | + ```ts [config.ts] |
| 108 | + export default { |
| 109 | + option: 'value' |
| 110 | + } |
| 111 | + ``` |
| 112 | + ::::: |
| 113 | + |
| 114 | +#title |
| 115 | +Configuration |
| 116 | + |
| 117 | +#description |
| 118 | +Easy to configure |
| 119 | +:::: |
| 120 | +``` |
| 121 | +
|
| 122 | +--- |
| 123 | +
|
| 124 | +## Content Components |
| 125 | +
|
| 126 | +| Component | Raw Docs | Use For | |
| 127 | +|-----------|----------|---------| |
| 128 | +| `code-group` | N/A (Nuxt Content) | Multi-tab code blocks | |
| 129 | +| `steps` | N/A (Nuxt Content) | Step-by-step guides | |
| 130 | +| `tabs` | [tabs.md](https://ui.nuxt.com/raw/docs/components/tabs.md) | Tabbed content | |
| 131 | +| `accordion` | [accordion.md](https://ui.nuxt.com/raw/docs/components/accordion.md) | Collapsible sections | |
| 132 | +
|
| 133 | +### Code Group (Nuxt Content) |
| 134 | +
|
| 135 | +```markdown |
| 136 | +::code-group |
| 137 | +```ts [nuxt.config.ts] |
| 138 | +export default defineNuxtConfig({}) |
| 139 | +``` |
| 140 | + |
| 141 | +```ts [app.config.ts] |
| 142 | +export default defineAppConfig({}) |
| 143 | +``` |
| 144 | +:: |
| 145 | +``` |
| 146 | +
|
| 147 | +### Steps (Nuxt Content) |
| 148 | +
|
| 149 | +```markdown |
| 150 | +::steps |
| 151 | +### Install |
| 152 | +
|
| 153 | +Run the install command. |
| 154 | +
|
| 155 | +### Configure |
| 156 | +
|
| 157 | +Add your configuration. |
| 158 | +
|
| 159 | +### Use |
| 160 | +
|
| 161 | +Start using the feature. |
| 162 | +:: |
| 163 | +``` |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +## Callout Components |
| 168 | + |
| 169 | +| Component | Use For | |
| 170 | +|-----------|---------| |
| 171 | +| `::note` | Additional information | |
| 172 | +| `::tip` | Helpful suggestions | |
| 173 | +| `::warning` | Important cautions | |
| 174 | +| `::caution` | Critical warnings | |
| 175 | + |
| 176 | +```markdown |
| 177 | +::note{title="Custom Title"} |
| 178 | +Additional context here. |
| 179 | +:: |
| 180 | + |
| 181 | +::tip |
| 182 | +Pro tip content. |
| 183 | +:: |
| 184 | + |
| 185 | +::warning |
| 186 | +Be careful with this. |
| 187 | +:: |
| 188 | + |
| 189 | +::caution |
| 190 | +This action cannot be undone. |
| 191 | +:: |
| 192 | +``` |
| 193 | + |
| 194 | +--- |
| 195 | + |
| 196 | +## Images |
| 197 | + |
| 198 | +### Color Mode Image |
| 199 | + |
| 200 | +```markdown |
| 201 | +:u-color-mode-image{alt="Feature" dark="/images/dark.png" light="/images/light.png" class="rounded-lg" width="859" height="400"} |
| 202 | +``` |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +## Grid Classes Reference |
| 207 | + |
| 208 | +| Class | Usage | |
| 209 | +|-------|-------| |
| 210 | +| `col-span-2` | Full width | |
| 211 | +| `col-span-2 lg:col-span-1` | Full mobile, half desktop | |
| 212 | +| `col-span-2 md:col-span-1` | Full mobile, half tablet+ | |
| 213 | + |
| 214 | +--- |
| 215 | + |
| 216 | +## Full Documentation Reference |
| 217 | + |
| 218 | +- **All components**: https://ui.nuxt.com/llms.txt |
| 219 | +- **Full docs (for LLMs)**: https://ui.nuxt.com/llms-full.txt |
| 220 | +- **Typography introduction**: https://ui.nuxt.com/raw/docs/typography.md |
| 221 | +- **Content integration**: https://ui.nuxt.com/raw/docs/getting-started/integrations/content.md |
| 222 | +- **Theme customization**: https://ui.nuxt.com/raw/docs/getting-started/theme/components.md |
0 commit comments