Typography
Usage
When using Nuxt UI Pro v3 with Nuxt Content v3, you get access to a set of pre-styled prose components.
Automatically when using the <ContentRenderer>
component, your markdown content will be automatically styled.
Prose Components
Prose components are replacements for HTML typography tags introduced by the @nuxtjs/mdc
module, Nuxt UI Pro overrides each one to provide a consistent look and feel.
Prose
prefix.<template>
<ProseTable>
<ProseThead>
<ProseTr>
<ProseTh>Prop</ProseTh>
<ProseTh>Default</ProseTh>
</ProseTr>
</ProseThead>
<ProseTbody>
<ProseTr>
<ProseTd>
<ProseCode>color</ProseCode>
</ProseTd>
<ProseTd>
<ProseCode>neutral</ProseCode>
</ProseTd>
</ProseTr>
</ProseTbody>
</ProseTable>
</template>
h1
Nuxt UI
# Nuxt UI
export default defineAppConfig({
uiPro: {
prose: {
h1: {
slots: {
base: 'text-4xl text-[var(--ui-text-highlighted)] font-bold mb-8 scroll-mt-[calc(45px+var(--ui-header-height))] lg:scroll-mt-[var(--ui-header-height)]',
link: 'inline-flex items-center gap-2'
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
h1: {
slots: {
base: 'text-4xl text-[var(--ui-text-highlighted)] font-bold mb-8 scroll-mt-[calc(45px+var(--ui-header-height))] lg:scroll-mt-[var(--ui-header-height)]',
link: 'inline-flex items-center gap-2'
}
}
}
}
})
]
})
h2
export default defineAppConfig({
uiPro: {
prose: {
h2: {
slots: {
base: [
'text-2xl text-[var(--ui-text-highlighted)] font-bold mt-12 mb-6 scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))] [&>a]:focus-visible:outline-[var(--ui-primary)] [&>a>code]:border-dashed hover:[&>a>code]:border-[var(--ui-primary)] hover:[&>a>code]:text-[var(--ui-primary)] [&>a>code]:text-xl/7 [&>a>code]:font-bold',
'[&>a>code]:transition-colors'
],
leading: [
'absolute -ms-8 mt-0.75 opacity-0 group-hover:opacity-100 group-focus:opacity-100 p-1 bg-[var(--ui-bg-elevated)] hover:text-[var(--ui-primary)] rounded-[calc(var(--ui-radius)*1.5)] hidden lg:flex text-[var(--ui-text-muted)]',
'transition'
],
leadingIcon: 'size-4 shrink-0',
link: 'group lg:ps-2 lg:-ms-2'
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
h2: {
slots: {
base: [
'text-2xl text-[var(--ui-text-highlighted)] font-bold mt-12 mb-6 scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))] [&>a]:focus-visible:outline-[var(--ui-primary)] [&>a>code]:border-dashed hover:[&>a>code]:border-[var(--ui-primary)] hover:[&>a>code]:text-[var(--ui-primary)] [&>a>code]:text-xl/7 [&>a>code]:font-bold',
'[&>a>code]:transition-colors'
],
leading: [
'absolute -ms-8 mt-0.75 opacity-0 group-hover:opacity-100 group-focus:opacity-100 p-1 bg-[var(--ui-bg-elevated)] hover:text-[var(--ui-primary)] rounded-[calc(var(--ui-radius)*1.5)] hidden lg:flex text-[var(--ui-text-muted)]',
'transition'
],
leadingIcon: 'size-4 shrink-0',
link: 'group lg:ps-2 lg:-ms-2'
}
}
}
}
})
]
})
h3
export default defineAppConfig({
uiPro: {
prose: {
h3: {
slots: {
base: [
'text-xl text-[var(--ui-text-highlighted)] font-bold mt-8 mb-3 scroll-mt-[calc(32px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(32px+var(--ui-header-height))] [&>a]:focus-visible:outline-[var(--ui-primary)] [&>a>code]:border-dashed hover:[&>a>code]:border-[var(--ui-primary)] hover:[&>a>code]:text-[var(--ui-primary)] [&>a>code]:text-lg/6 [&>a>code]:font-bold',
'[&>a>code]:transition-colors'
],
leading: [
'absolute -ms-8 mt-0.25 opacity-0 group-hover:opacity-100 group-focus:opacity-100 p-1 bg-[var(--ui-bg-elevated)] hover:text-[var(--ui-primary)] rounded-[calc(var(--ui-radius)*1.5)] hidden lg:flex text-[var(--ui-text-muted)]',
'transition'
],
leadingIcon: 'size-4 shrink-0',
link: 'group lg:ps-2 lg:-ms-2'
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
h3: {
slots: {
base: [
'text-xl text-[var(--ui-text-highlighted)] font-bold mt-8 mb-3 scroll-mt-[calc(32px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(32px+var(--ui-header-height))] [&>a]:focus-visible:outline-[var(--ui-primary)] [&>a>code]:border-dashed hover:[&>a>code]:border-[var(--ui-primary)] hover:[&>a>code]:text-[var(--ui-primary)] [&>a>code]:text-lg/6 [&>a>code]:font-bold',
'[&>a>code]:transition-colors'
],
leading: [
'absolute -ms-8 mt-0.25 opacity-0 group-hover:opacity-100 group-focus:opacity-100 p-1 bg-[var(--ui-bg-elevated)] hover:text-[var(--ui-primary)] rounded-[calc(var(--ui-radius)*1.5)] hidden lg:flex text-[var(--ui-text-muted)]',
'transition'
],
leadingIcon: 'size-4 shrink-0',
link: 'group lg:ps-2 lg:-ms-2'
}
}
}
}
})
]
})
h4
#### Install Nuxt UI
export default defineAppConfig({
uiPro: {
prose: {
h4: {
slots: {
base: 'text-lg text-[var(--ui-text-highlighted)] font-bold mt-6 mb-2 scroll-mt-[calc(24px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(24px+var(--ui-header-height))] [&>a]:focus-visible:outline-[var(--ui-primary)]',
link: ''
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
h4: {
slots: {
base: 'text-lg text-[var(--ui-text-highlighted)] font-bold mt-6 mb-2 scroll-mt-[calc(24px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(24px+var(--ui-header-height))] [&>a]:focus-visible:outline-[var(--ui-primary)]',
link: ''
}
}
}
}
})
]
})
p
Nuxt UI Pro is a collection of Vue components, composables and utils built on top of Nuxt UI, oriented on structure and layout and designed to be used as building blocks for your app.
Nuxt UI Pro is a collection of Vue components, composables and utils built on top of Nuxt UI, oriented on structure and layout and designed to be used as building blocks for your app.
export default defineAppConfig({
uiPro: {
prose: {
p: {
base: 'my-5 leading-7 text-pretty'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
p: {
base: 'my-5 leading-7 text-pretty'
}
}
}
})
]
})
a
[Nuxt documentation](https://nuxt.com)
export default defineAppConfig({
uiPro: {
prose: {
a: {
base: [
'text-[var(--ui-primary)] border-b border-transparent hover:border-[var(--ui-primary)] font-medium focus-visible:outline-[var(--ui-primary)] [&>code]:border-dashed hover:[&>code]:border-[var(--ui-primary)] hover:[&>code]:text-[var(--ui-primary)]',
'transition-colors [&>code]:transition-colors'
]
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
a: {
base: [
'text-[var(--ui-primary)] border-b border-transparent hover:border-[var(--ui-primary)] font-medium focus-visible:outline-[var(--ui-primary)] [&>code]:border-dashed hover:[&>code]:border-[var(--ui-primary)] hover:[&>code]:text-[var(--ui-primary)]',
'transition-colors [&>code]:transition-colors'
]
}
}
}
})
]
})
blockquote
While Nuxt UI is free and open source, Nuxt UI Pro is a premium product that helps sustain Nuxt OSS development, check out the License section to learn more.
> While Nuxt UI is free and open source, Nuxt UI Pro is a premium product that helps sustain Nuxt OSS development, check out the License section to learn more.
export default defineAppConfig({
uiPro: {
prose: {
blockquote: {
base: 'border-s-4 border-[var(--ui-border-accented)] ps-4 italic'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
blockquote: {
base: 'border-s-4 border-[var(--ui-border-accented)] ps-4 italic'
}
}
}
})
]
})
strong
Strong text
**Strong text**
export default defineAppConfig({
uiPro: {
prose: {
strong: {
base: ''
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
strong: {
base: ''
}
}
}
})
]
})
em
Emphasized text
*Emphasized text*
export default defineAppConfig({
uiPro: {
prose: {
em: {
base: ''
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
em: {
base: ''
}
}
}
})
]
})
ul
- I'm a list item.
- I'm another list item.
- I'm the last list item.
- I'm a list item.
- I'm another list item.
- I'm the last list item.
export default defineAppConfig({
uiPro: {
prose: {
ul: {
base: 'list-disc ps-6 my-5 marker:text-[var(--ui-border-accented)]'
},
li: {
base: 'my-1.5 ps-1.5 leading-7 [&>ul]:my-0'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
ul: {
base: 'list-disc ps-6 my-5 marker:text-[var(--ui-border-accented)]'
},
li: {
base: 'my-1.5 ps-1.5 leading-7 [&>ul]:my-0'
}
}
}
})
]
})
ol
- I'm a list item.
- I'm another list item.
- I'm the last list item.
1. I'm a list item.
2. I'm another list item.
3. I'm the last list item.
export default defineAppConfig({
uiPro: {
prose: {
ol: {
base: 'list-decimal ps-6 my-5'
},
li: {
base: 'my-1.5 ps-1.5 leading-7 [&>ul]:my-0'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
ol: {
base: 'list-decimal ps-6 my-5'
},
li: {
base: 'my-1.5 ps-1.5 leading-7 [&>ul]:my-0'
}
}
}
})
]
})
hr
---
export default defineAppConfig({
uiPro: {
prose: {
hr: {
base: 'border-t border-[var(--ui-border)] my-12'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
hr: {
base: 'border-t border-[var(--ui-border)] my-12'
}
}
}
})
]
})
table
Prop | Default | Type |
---|---|---|
name | string | |
size | md | string |
color | neutral | string |
| Prop | Default | Type |
|---------|-----------|--------------------------|
| `name` | | `string`{lang="ts-type"} |
| `size` | `md` | `string`{lang="ts-type"} |
| `color` | `neutral` | `string`{lang="ts-type"} |
export default defineAppConfig({
uiPro: {
prose: {
table: {
slots: {
root: 'relative my-5 overflow-x-auto',
base: 'w-full border-separate border-spacing-0 rounded-[calc(var(--ui-radius)*1.5)]'
}
},
thead: {
base: 'bg-[var(--ui-bg-muted)]'
},
tbody: {
base: ''
},
tr: {
base: '[&:first-child>th:first-child]:rounded-tl-[calc(var(--ui-radius)*1.5)] [&:first-child>th:last-child]:rounded-tr-[calc(var(--ui-radius)*1.5)] [&:last-child>td:first-child]:rounded-bl-[calc(var(--ui-radius)*1.5)] [&:last-child>td:last-child]:rounded-br-[calc(var(--ui-radius)*1.5)]'
},
th: {
base: 'py-3 px-4 font-semibold text-sm text-left border-e border-b first:border-s border-t border-[var(--ui-border-muted)]'
},
td: {
base: 'py-3 px-4 text-sm text-left align-top border-e border-b first:border-s border-[var(--ui-border-muted)] [&_code]:text-xs/5 [&_p]:my-0 [&_p]:leading-6 [&_ul]:my-0 [&_ol]:my-0 [&_ul]:ps-4.5 [&_ol]:ps-4.5 [&_li]:leading-6 [&_li]:my-0.5'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
table: {
slots: {
root: 'relative my-5 overflow-x-auto',
base: 'w-full border-separate border-spacing-0 rounded-[calc(var(--ui-radius)*1.5)]'
}
},
thead: {
base: 'bg-[var(--ui-bg-muted)]'
},
tbody: {
base: ''
},
tr: {
base: '[&:first-child>th:first-child]:rounded-tl-[calc(var(--ui-radius)*1.5)] [&:first-child>th:last-child]:rounded-tr-[calc(var(--ui-radius)*1.5)] [&:last-child>td:first-child]:rounded-bl-[calc(var(--ui-radius)*1.5)] [&:last-child>td:last-child]:rounded-br-[calc(var(--ui-radius)*1.5)]'
},
th: {
base: 'py-3 px-4 font-semibold text-sm text-left border-e border-b first:border-s border-t border-[var(--ui-border-muted)]'
},
td: {
base: 'py-3 px-4 text-sm text-left align-top border-e border-b first:border-s border-[var(--ui-border-muted)] [&_code]:text-xs/5 [&_p]:my-0 [&_p]:leading-6 [&_ul]:my-0 [&_ol]:my-0 [&_ul]:ps-4.5 [&_ol]:ps-4.5 [&_li]:leading-6 [&_li]:my-0.5'
}
}
}
})
]
})
img
![Nuxt Social Image](https://nuxt.com/new-social.jpg)
Prop | Default | Type |
---|---|---|
src |
| |
alt |
| |
width |
| |
height |
|
export default defineAppConfig({
uiPro: {
prose: {
img: {
base: ''
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
img: {
base: ''
}
}
}
})
]
})
code
inline code
`inline code`
You can use the color
prop to specify the color of the code block. Defaults to neutral
.
inline code
`inline code`{color="error"}
You can use the lang
prop to specify the language of the code block.
nuxt.config.ts
`nuxt.config.ts`{lang="ts-type"}
Prop | Default | Type |
---|---|---|
lang |
| |
color |
|
|
export default defineAppConfig({
uiPro: {
prose: {
code: {
base: 'px-1.5 py-0.5 text-sm font-mono font-medium rounded-[calc(var(--ui-radius)*1.5)] inline-block',
variants: {
color: {
primary: 'border border-[var(--ui-primary)]/25 bg-[var(--ui-primary)]/10 text-[var(--ui-primary)]',
secondary: 'border border-[var(--ui-secondary)]/25 bg-[var(--ui-secondary)]/10 text-[var(--ui-secondary)]',
success: 'border border-[var(--ui-success)]/25 bg-[var(--ui-success)]/10 text-[var(--ui-success)]',
info: 'border border-[var(--ui-info)]/25 bg-[var(--ui-info)]/10 text-[var(--ui-info)]',
warning: 'border border-[var(--ui-warning)]/25 bg-[var(--ui-warning)]/10 text-[var(--ui-warning)]',
error: 'border border-[var(--ui-error)]/25 bg-[var(--ui-error)]/10 text-[var(--ui-error)]',
neutral: 'border border-[var(--ui-border-muted)] text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-muted)]'
}
},
defaultVariants: {
color: 'neutral'
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
code: {
base: 'px-1.5 py-0.5 text-sm font-mono font-medium rounded-[calc(var(--ui-radius)*1.5)] inline-block',
variants: {
color: {
primary: 'border border-[var(--ui-primary)]/25 bg-[var(--ui-primary)]/10 text-[var(--ui-primary)]',
secondary: 'border border-[var(--ui-secondary)]/25 bg-[var(--ui-secondary)]/10 text-[var(--ui-secondary)]',
success: 'border border-[var(--ui-success)]/25 bg-[var(--ui-success)]/10 text-[var(--ui-success)]',
info: 'border border-[var(--ui-info)]/25 bg-[var(--ui-info)]/10 text-[var(--ui-info)]',
warning: 'border border-[var(--ui-warning)]/25 bg-[var(--ui-warning)]/10 text-[var(--ui-warning)]',
error: 'border border-[var(--ui-error)]/25 bg-[var(--ui-error)]/10 text-[var(--ui-error)]',
neutral: 'border border-[var(--ui-border-muted)] text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-muted)]'
}
},
defaultVariants: {
color: 'neutral'
}
}
}
}
})
]
})
pre
Code-blocks are rendered by the ProsePre
component of @nuxtjs/mdc
and code highlighting is done underneath by Shiki.
material-theme-lighter
and material-theme-palenight
VSCode themes are used for light & dark mode respectively. You can change this in your nuxt.config.ts
through the content.build.markdown.highlight
key.export default defineNuxtConfig({
modules: ['@nuxt/ui-pro']
})
```ts
export default defineNuxtConfig({
modules: ['@nuxt/ui-pro']
})
```
When writing a code-block, you can specify a filename that will be displayed on top of the code block. An icon will be automatically displayed based on the extension or the name.
export default defineNuxtConfig({
modules: ['@nuxt/ui-pro']
})
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui-pro']
})
```
app.config.ts
through the uiPro.prose.codeIcon
key:export default defineAppConfig({
uiPro: {
prose: {
codeIcon: {
terminal: 'i-ph-terminal-window-duotone'
}
}
}
})
Every code-block has a built-in copy button that will copy the code to your clipboard.
app.config.ts
through the ui.icons.copy
and ui.icons.copyCheck
keys:export default defineAppConfig({
ui: {
icons: {
copy: 'i-lucide-copy',
copyCheck: 'i-lucide-copy-check'
}
}
})
Prop | Default | Type |
---|---|---|
icon |
| |
code |
| |
language |
| |
filename |
| |
highlights |
| |
hideHeader |
| |
meta |
| |
ui |
|
export default defineAppConfig({
uiPro: {
prose: {
pre: {
slots: {
root: 'relative my-5 group',
header: 'flex items-center gap-1.5 border border-[var(--ui-border-muted)] bg-[var(--ui-bg)] border-b-0 relative rounded-t-[calc(var(--ui-radius)*1.5)] px-4 py-3',
filename: 'text-[var(--ui-text)] text-sm/6',
icon: 'size-4 shrink-0',
copy: 'absolute top-[11px] right-[11px] opacity-0 group-hover:opacity-100 transition',
base: 'group font-mono text-sm/6 border border-[var(--ui-border-muted)] bg-[var(--ui-bg-muted)] rounded-[calc(var(--ui-radius)*1.5)] px-4 py-3 whitespace-pre-wrap break-words overflow-x-auto focus:outline-none'
},
variants: {
filename: {
true: {
root: '[&>pre]:rounded-t-none [&>pre]:my-0 my-5'
}
}
}
},
codeIcon: {
'package.json': 'i-vscode-icons-file-type-node',
'tsconfig.json': 'i-vscode-icons-file-type-tsconfig',
'.npmrc': 'i-vscode-icons-file-type-npm',
'.editorconfig': 'i-vscode-icons-file-type-editorconfig',
'.eslintrc': 'i-vscode-icons-file-type-eslint',
'.eslintrc.cjs': 'i-vscode-icons-file-type-eslint',
'.eslintignore': 'i-vscode-icons-file-type-eslint',
'eslint.config.js': 'i-vscode-icons-file-type-eslint',
'eslint.config.mjs': 'i-vscode-icons-file-type-eslint',
'eslint.config.cjs': 'i-vscode-icons-file-type-eslint',
'.gitignore': 'i-vscode-icons-file-type-git',
'yarn.lock': 'i-vscode-icons-file-type-yarn',
'.env': 'i-vscode-icons-file-type-dotenv',
'.env.example': 'i-vscode-icons-file-type-dotenv',
'.vscode/settings.json': 'i-vscode-icons-file-type-vscode',
nuxt: 'i-vscode-icons-file-type-nuxt',
'.nuxtrc': 'i-vscode-icons-file-type-nuxt',
'.nuxtignore': 'i-vscode-icons-file-type-nuxt',
'nuxt.config.js': 'i-vscode-icons-file-type-nuxt',
'nuxt.config.ts': 'i-vscode-icons-file-type-nuxt',
'nuxt.schema.ts': 'i-vscode-icons-file-type-nuxt',
'tailwind.config.js': 'i-vscode-icons-file-type-tailwind',
'tailwind.config.ts': 'i-vscode-icons-file-type-tailwind',
vue: 'i-vscode-icons-file-type-vue',
ts: 'i-vscode-icons-file-type-typescript',
tsx: 'i-vscode-icons-file-type-typescript',
mjs: 'i-vscode-icons-file-type-js',
cjs: 'i-vscode-icons-file-type-js',
js: 'i-vscode-icons-file-type-js',
jsx: 'i-vscode-icons-file-type-js',
md: 'i-vscode-icons-file-type-markdown',
py: 'i-vscode-icons-file-type-python',
cs: 'i-vscode-icons-file-type-csharp',
asm: 'i-vscode-icons-file-type-assembly',
f: 'i-vscode-icons-file-type-fortran',
hs: 'i-vscode-icons-file-type-haskell',
fs: 'i-vscode-icons-file-type-fsharp',
kt: 'i-vscode-icons-file-type-kotlin',
rs: 'i-vscode-icons-file-type-rust',
rb: 'i-vscode-icons-file-type-ruby',
lsp: 'i-vscode-icons-file-type-lisp',
exs: 'i-vscode-icons-file-type-elixir',
erl: 'i-vscode-icons-file-type-erlang',
sbt: 'i-vscode-icons-file-type-scala',
h: 'i-vscode-icons-file-type-cppheader',
ino: 'i-vscode-icons-file-type-arduino',
pl: 'i-vscode-icons-file-type-perl',
jl: 'i-vscode-icons-file-type-julia',
dart: 'i-vscode-icons-file-type-dartlang',
ico: 'i-vscode-icons-file-type-favicon',
npm: 'i-vscode-icons-file-type-npm',
pnpm: 'i-vscode-icons-file-type-pnpm',
npx: 'i-vscode-icons-file-type-npm',
yarn: 'i-vscode-icons-file-type-yarn',
bun: 'i-vscode-icons-file-type-bun',
yml: 'i-vscode-icons-file-type-yaml',
terminal: 'i-lucide-terminal'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
pre: {
slots: {
root: 'relative my-5 group',
header: 'flex items-center gap-1.5 border border-[var(--ui-border-muted)] bg-[var(--ui-bg)] border-b-0 relative rounded-t-[calc(var(--ui-radius)*1.5)] px-4 py-3',
filename: 'text-[var(--ui-text)] text-sm/6',
icon: 'size-4 shrink-0',
copy: 'absolute top-[11px] right-[11px] opacity-0 group-hover:opacity-100 transition',
base: 'group font-mono text-sm/6 border border-[var(--ui-border-muted)] bg-[var(--ui-bg-muted)] rounded-[calc(var(--ui-radius)*1.5)] px-4 py-3 whitespace-pre-wrap break-words overflow-x-auto focus:outline-none'
},
variants: {
filename: {
true: {
root: '[&>pre]:rounded-t-none [&>pre]:my-0 my-5'
}
}
}
},
codeIcon: {
'package.json': 'i-vscode-icons-file-type-node',
'tsconfig.json': 'i-vscode-icons-file-type-tsconfig',
'.npmrc': 'i-vscode-icons-file-type-npm',
'.editorconfig': 'i-vscode-icons-file-type-editorconfig',
'.eslintrc': 'i-vscode-icons-file-type-eslint',
'.eslintrc.cjs': 'i-vscode-icons-file-type-eslint',
'.eslintignore': 'i-vscode-icons-file-type-eslint',
'eslint.config.js': 'i-vscode-icons-file-type-eslint',
'eslint.config.mjs': 'i-vscode-icons-file-type-eslint',
'eslint.config.cjs': 'i-vscode-icons-file-type-eslint',
'.gitignore': 'i-vscode-icons-file-type-git',
'yarn.lock': 'i-vscode-icons-file-type-yarn',
'.env': 'i-vscode-icons-file-type-dotenv',
'.env.example': 'i-vscode-icons-file-type-dotenv',
'.vscode/settings.json': 'i-vscode-icons-file-type-vscode',
nuxt: 'i-vscode-icons-file-type-nuxt',
'.nuxtrc': 'i-vscode-icons-file-type-nuxt',
'.nuxtignore': 'i-vscode-icons-file-type-nuxt',
'nuxt.config.js': 'i-vscode-icons-file-type-nuxt',
'nuxt.config.ts': 'i-vscode-icons-file-type-nuxt',
'nuxt.schema.ts': 'i-vscode-icons-file-type-nuxt',
'tailwind.config.js': 'i-vscode-icons-file-type-tailwind',
'tailwind.config.ts': 'i-vscode-icons-file-type-tailwind',
vue: 'i-vscode-icons-file-type-vue',
ts: 'i-vscode-icons-file-type-typescript',
tsx: 'i-vscode-icons-file-type-typescript',
mjs: 'i-vscode-icons-file-type-js',
cjs: 'i-vscode-icons-file-type-js',
js: 'i-vscode-icons-file-type-js',
jsx: 'i-vscode-icons-file-type-js',
md: 'i-vscode-icons-file-type-markdown',
py: 'i-vscode-icons-file-type-python',
cs: 'i-vscode-icons-file-type-csharp',
asm: 'i-vscode-icons-file-type-assembly',
f: 'i-vscode-icons-file-type-fortran',
hs: 'i-vscode-icons-file-type-haskell',
fs: 'i-vscode-icons-file-type-fsharp',
kt: 'i-vscode-icons-file-type-kotlin',
rs: 'i-vscode-icons-file-type-rust',
rb: 'i-vscode-icons-file-type-ruby',
lsp: 'i-vscode-icons-file-type-lisp',
exs: 'i-vscode-icons-file-type-elixir',
erl: 'i-vscode-icons-file-type-erlang',
sbt: 'i-vscode-icons-file-type-scala',
h: 'i-vscode-icons-file-type-cppheader',
ino: 'i-vscode-icons-file-type-arduino',
pl: 'i-vscode-icons-file-type-perl',
jl: 'i-vscode-icons-file-type-julia',
dart: 'i-vscode-icons-file-type-dartlang',
ico: 'i-vscode-icons-file-type-favicon',
npm: 'i-vscode-icons-file-type-npm',
pnpm: 'i-vscode-icons-file-type-pnpm',
npx: 'i-vscode-icons-file-type-npm',
yarn: 'i-vscode-icons-file-type-yarn',
bun: 'i-vscode-icons-file-type-bun',
yml: 'i-vscode-icons-file-type-yaml',
terminal: 'i-lucide-terminal'
}
}
}
})
]
})
Vue Components
Nuxt UI Pro also provides a set of Vue components to help you write your content using the MDC syntax.
Accordion
Use the accordion
and accordion-item
components to display an Accordion in your content.
The transition to v3 involves significant changes, including new component structures, updated theming approaches, and revised TypeScript definitions. We recommend a careful, incremental upgrade process, starting with thorough testing in a development environment.
Nuxt UI is now compatible with Vue! You can follow the installation guide to get started.
We've also rebuilt Nuxt UI Pro from scratch and released a v3.0.0-alpha.x
package but it only contains the components to build this documentation yet. This will be a free update, so the license you buy now will be valid for v3. We're actively working to finish the rewrite of all Nuxt UI Pro components.
::accordion
::accordion-item{label="What are the main considerations when upgrading to Nuxt UI v3?" icon="i-lucide-circle-help"}
The transition to v3 involves significant changes, including new component structures, updated theming approaches, and revised TypeScript definitions. We recommend a careful, incremental upgrade process, starting with thorough testing in a development environment.
::
::accordion-item{label="Is Nuxt UI v3 compatible with standalone Vue projects?" icon="i-lucide-circle-help"}
Nuxt UI is now compatible with Vue! You can follow the [installation guide](/getting-started/installation/vue) to get started.
::
::accordion-item{label="What about Nuxt UI Pro?" icon="i-lucide-circle-help"}
We've also rebuilt Nuxt UI Pro from scratch and released a `v3.0.0-alpha.x` package but it only contains the components to build this documentation yet. This will be a free update, so the license you buy now will be valid for v3. We're actively working to finish the rewrite of all Nuxt UI Pro components.
::
::
Prop | Default | Type |
---|---|---|
type |
|
|
export default defineAppConfig({
uiPro: {
prose: {
accordion: {
slots: {
root: 'my-5',
trigger: 'text-base'
}
},
accordionItem: {
base: 'leading-7 pb-3.5 text-[var(--ui-text-muted)]'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
accordion: {
slots: {
root: 'my-5',
trigger: 'text-base'
}
},
accordionItem: {
base: 'leading-7 pb-3.5 text-[var(--ui-text-muted)]'
}
}
}
})
]
})
Badge
Use markdown in the default slot of the badge
component to display a Badge in your content.
::badge
**v3.0.0-alpha.10**
::
export default defineAppConfig({
uiPro: {
prose: {
badge: {
base: 'rounded-full'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
badge: {
base: 'rounded-full'
}
}
}
})
]
})
Callout
Use markdown in the default slot of the callout
component to add eye-catching context to your content.
Use the icon
and color
props to customize it. You can also pass any property from the <NuxtLink>
component.
::callout{icon="i-lucide-square-play" color="neutral" to="/getting-started/installation/pro/nuxt"}
This is a `callout` with full **markdown** support.
::
You can also use the note
, tip
, warning
and caution
shortcuts with pre-defined icons and colors.
::note
Here's some additional information.
::
::tip
Here's a helpful suggestion.
::
::warning
Be careful with this action as it might have unexpected results.
::
::caution
This action cannot be undone.
::
Card
Use markdown in the default slot of the card
component to highlight your content.
Use the title
, icon
and color
props to customize it. You can also pass any property from the <NuxtLink>
.
::card{title="Startup" icon="i-lucide-users" color="primary" to="https://nuxt.lemonsqueezy.com" target="_blank"}
Best suited for small teams, startups and agencies with up to 5 developers.
::
CardGroup
Wrap your card
components with the card-group
component to group them together in a grid layout.
::card-group
::card
---
title: Dashboard
icon: i-simple-icons-github
to: https://github.com/nuxt-ui-pro/dashboard
target: _blank
---
A dashboard with multi-column layout.
::
::card
---
title: SaaS
icon: i-simple-icons-github
to: https://github.com/nuxt-ui-pro/saas
target: _blank
---
A template with landing, pricing, docs and blog.
::
::card
---
title: Docs
icon: i-simple-icons-github
to: https://github.com/nuxt-ui-pro/docs
target: _blank
---
A documentation with `@nuxt/content`.
::
::card
---
title: Landing
icon: i-simple-icons-github
to: https://github.com/nuxt-ui-pro/landing
target: _blank
---
A landing page you can use as starting point.
::
::
export default defineAppConfig({
uiPro: {
prose: {
cardGroup: {
base: 'grid sm:grid-cols-2 gap-5'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
cardGroup: {
base: 'grid sm:grid-cols-2 gap-5'
}
}
}
})
]
})
CodeCollapse
Wrap your code-block with a code-collapse
component to display a collapsible code block.
@import "tailwindcss";
@import "@nuxt/ui-pro";
@theme {
--font-sans: 'Public Sans', sans-serif;
--breakpoint-3xl: 1920px;
--color-green-50: #EFFDF5;
--color-green-100: #D9FBE8;
--color-green-200: #B3F5D1;
--color-green-300: #75EDAE;
--color-green-400: #00DC82;
--color-green-500: #00C16A;
--color-green-600: #00A155;
--color-green-700: #007F45;
--color-green-800: #016538;
--color-green-900: #0A5331;
--color-green-950: #052E16;
}
::code-collapse
```css [main.css]
@import "tailwindcss";
@import "@nuxt/ui-pro";
@theme {
--font-sans: 'Public Sans', sans-serif;
--breakpoint-3xl: 1920px;
--color-green-50: #EFFDF5;
--color-green-100: #D9FBE8;
--color-green-200: #B3F5D1;
--color-green-300: #75EDAE;
--color-green-400: #00DC82;
--color-green-500: #00C16A;
--color-green-600: #00A155;
--color-green-700: #007F45;
--color-green-800: #016538;
--color-green-900: #0A5331;
--color-green-950: #052E16;
}
```
::
Prop | Default | Type |
---|---|---|
open |
| |
icon |
|
The icon displayed to toggle the code. |
name |
|
The name displayed in the trigger label. |
openText |
|
The text displayed when the code is collapsed. |
closeText |
|
The text displayed when the code is expanded. |
ui |
|
export default defineAppConfig({
uiPro: {
prose: {
codeCollapse: {
slots: {
root: 'relative [&_pre]:h-[200px]',
footer: 'h-16 absolute inset-x-px bottom-px rounded-b-[calc(var(--ui-radius)*1.5)] flex items-center justify-center',
trigger: 'group',
triggerIcon: 'group-data-[state=open]:rotate-180'
},
variants: {
open: {
true: {
root: '[&_pre]:h-auto [&_pre]:min-h-[200px] [&_pre]:max-h-[80vh] [&_pre]:pb-12'
},
false: {
root: '[&_pre]:overflow-hidden',
footer: 'bg-gradient-to-t from-[var(--ui-bg-muted)]'
}
}
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
codeCollapse: {
slots: {
root: 'relative [&_pre]:h-[200px]',
footer: 'h-16 absolute inset-x-px bottom-px rounded-b-[calc(var(--ui-radius)*1.5)] flex items-center justify-center',
trigger: 'group',
triggerIcon: 'group-data-[state=open]:rotate-180'
},
variants: {
open: {
true: {
root: '[&_pre]:h-auto [&_pre]:min-h-[200px] [&_pre]:max-h-[80vh] [&_pre]:pb-12'
},
false: {
root: '[&_pre]:overflow-hidden',
footer: 'bg-gradient-to-t from-[var(--ui-bg-muted)]'
}
}
}
}
}
}
})
]
})
CodeGroup
Wrap your code-blocks around a code-group
component to group them together in tabs.
pnpm add @nuxt/ui-pro@next
yarn add @nuxt/ui-pro@next
npm install @nuxt/ui-pro@next
bun add @nuxt/ui-pro@next
::code-group
```bash [pnpm]
pnpm add @nuxt/ui-pro@next
```
```bash [yarn]
yarn add @nuxt/ui-pro@next
```
```bash [npm]
npm install @nuxt/ui-pro@next
```
```bash [bun]
bun add @nuxt/ui-pro@next
```
::
Prop | Default | Type |
---|---|---|
modelValue |
| |
defaultValue |
|
The default tab to select. |
sync |
Sync the selected tab with a local storage key. | |
ui |
|
export default defineAppConfig({
uiPro: {
prose: {
codeGroup: {
slots: {
root: 'relative group *:not-first:!my-0 *:not-first:!static my-5',
list: 'relative flex items-center gap-1 border border-[var(--ui-border-muted)] bg-[var(--ui-bg)] border-b-0 rounded-t-[calc(var(--ui-radius)*1.5)] overflow-x-auto p-2',
indicator: 'absolute left-0 inset-y-2 w-[var(--reka-tabs-indicator-size)] translate-x-[var(--reka-tabs-indicator-position)] transition-[translate,width] duration-200 bg-[var(--ui-bg-elevated)] rounded-[calc(var(--ui-radius)*1.5)] shadow-xs',
trigger: [
'relative inline-flex items-center gap-1.5 text-[var(--ui-text)] data-[state=active]:text-[var(--ui-text-highlighted)] hover:bg-[var(--ui-bg-elevated)]/50 px-2 py-1.5 text-sm rounded-[calc(var(--ui-radius)*1.5)] disabled:cursor-not-allowed disabled:opacity-75 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-primary)] focus:outline-none',
'transition-colors'
],
triggerIcon: 'size-4 shrink-0',
triggerLabel: 'truncate'
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
codeGroup: {
slots: {
root: 'relative group *:not-first:!my-0 *:not-first:!static my-5',
list: 'relative flex items-center gap-1 border border-[var(--ui-border-muted)] bg-[var(--ui-bg)] border-b-0 rounded-t-[calc(var(--ui-radius)*1.5)] overflow-x-auto p-2',
indicator: 'absolute left-0 inset-y-2 w-[var(--reka-tabs-indicator-size)] translate-x-[var(--reka-tabs-indicator-position)] transition-[translate,width] duration-200 bg-[var(--ui-bg-elevated)] rounded-[calc(var(--ui-radius)*1.5)] shadow-xs',
trigger: [
'relative inline-flex items-center gap-1.5 text-[var(--ui-text)] data-[state=active]:text-[var(--ui-text-highlighted)] hover:bg-[var(--ui-bg-elevated)]/50 px-2 py-1.5 text-sm rounded-[calc(var(--ui-radius)*1.5)] disabled:cursor-not-allowed disabled:opacity-75 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-primary)] focus:outline-none',
'transition-colors'
],
triggerIcon: 'size-4 shrink-0',
triggerLabel: 'truncate'
}
}
}
}
})
]
})
CodePreview
Wrap a code-block with the code-preview
component to display a preview of an MDC component and its code using the code
slot.
inline code
`inline code`
::code-preview
`inline code`
#code
```mdc
`inline code`
```
::
Prop | Default | Type |
---|---|---|
ui |
|
export default defineAppConfig({
uiPro: {
prose: {
codePreview: {
slots: {
root: 'my-5',
preview: 'flex justify-center border border-[var(--ui-border-muted)] relative p-4 rounded-[calc(var(--ui-radius)*1.5)]',
code: '[&>div>pre]:rounded-t-none [&>div]:my-0'
},
variants: {
code: {
true: {
preview: 'border-b-0 rounded-b-none'
}
}
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
codePreview: {
slots: {
root: 'my-5',
preview: 'flex justify-center border border-[var(--ui-border-muted)] relative p-4 rounded-[calc(var(--ui-radius)*1.5)]',
code: '[&>div>pre]:rounded-t-none [&>div]:my-0'
},
variants: {
code: {
true: {
preview: 'border-b-0 rounded-b-none'
}
}
}
}
}
}
})
]
})
CodeTree
Wrap your code-blocks with a code-tree
component in any particular order to display a tree view of your files.
export default defineAppConfig({
ui: {
colors: {
primary: 'sky',
colors: 'slate'
}
}
})
::code-tree{defaultValue="app/app.config.ts"}
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui-pro'],
future: {
compatibilityVersion: 4
},
css: ['~/assets/css/main.css']
})
```
```css [app/assets/css/main.css]
@import "tailwindcss";
@import "@nuxt/ui-pro";
```
```ts [app/app.config.ts]
export default defineAppConfig({
ui: {
colors: {
primary: 'sky',
colors: 'slate'
}
}
})
```
```vue [app/app.vue]
<template>
<UApp>
<NuxtPage />
</UApp>
</template>
```
```json [package.json]
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"typecheck": "nuxt typecheck"
},
"dependencies": {
"@iconify-json/lucide": "^1.2.18",
"@nuxt/ui-pro": "3.0.0-alpha.10",
"nuxt": "^3.15.1"
},
"devDependencies": {
"typescript": "^5.7.2",
"vue-tsc": "^2.2.0"
}
}
```
```json [tsconfig.json]
{
"extends": "./.nuxt/tsconfig.json"
}
```
````md [README.md]
# Nuxt 3 Minimal Starter
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
## Setup
Make sure to install the dependencies:
```bash
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun install
```
## Development Server
Start the development server on `http://localhost:3000`:
```bash
# npm
npm run dev
# pnpm
pnpm run dev
# yarn
yarn dev
# bun
bun run dev
```
## Production
Build the application for production:
```bash
# npm
npm run build
# pnpm
pnpm run build
# yarn
yarn build
# bun
bun run build
```
Locally preview production build:
```bash
# npm
npm run preview
# pnpm
pnpm run preview
# yarn
yarn preview
# bun
bun run preview
```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
````
::
Prop | Default | Type |
---|---|---|
defaultValue |
The default path to select. | |
ui |
|
export default defineAppConfig({
uiPro: {
prose: {
codeTree: {
slots: {
root: 'relative lg:h-[450px] my-5 grid lg:grid-cols-3 border border-[var(--ui-border-muted)] rounded-[calc(var(--ui-radius)*1.5)]',
list: 'isolate relative p-2 border-b lg:border-b-0 lg:border-e border-[var(--ui-border-muted)] overflow-y-auto',
item: '',
listWithChildren: 'ms-4.5 border-s border-[var(--ui-border)]',
itemWithChildren: 'ps-1.5 -ms-px',
link: 'relative group peer w-full px-2.5 py-1.5 before:inset-y-px before:inset-x-0 flex items-center gap-1.5 text-sm before:absolute before:z-[-1] before:rounded-[calc(var(--ui-radius)*1.5)] focus:outline-none focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2',
linkLeadingIcon: 'size-4 shrink-0',
linkLabel: 'truncate',
linkTrailing: 'ms-auto inline-flex gap-1.5 items-center',
linkTrailingIcon: 'size-5 transform transition-transform duration-200 shrink-0 group-data-expanded:rotate-180',
content: 'overflow-hidden lg:col-span-2 flex flex-col [&>div]:my-0 [&>div]:flex-1 [&>div]:flex [&>div]:flex-col [&>div>div]:border-0 [&>div>pre]:border-b-0 [&>div>pre]:border-s-0 [&>div>pre]:border-e-0 [&>div>pre]:rounded-l-none [&>div>pre]:flex-1 [&>div]:overflow-y-auto'
},
variants: {
active: {
true: {
link: 'text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]'
},
false: {
link: [
'hover:text-[var(--ui-text-highlighted)] hover:before:bg-[var(--ui-bg-elevated)]/50',
'transition-colors before:transition-colors'
]
}
}
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
codeTree: {
slots: {
root: 'relative lg:h-[450px] my-5 grid lg:grid-cols-3 border border-[var(--ui-border-muted)] rounded-[calc(var(--ui-radius)*1.5)]',
list: 'isolate relative p-2 border-b lg:border-b-0 lg:border-e border-[var(--ui-border-muted)] overflow-y-auto',
item: '',
listWithChildren: 'ms-4.5 border-s border-[var(--ui-border)]',
itemWithChildren: 'ps-1.5 -ms-px',
link: 'relative group peer w-full px-2.5 py-1.5 before:inset-y-px before:inset-x-0 flex items-center gap-1.5 text-sm before:absolute before:z-[-1] before:rounded-[calc(var(--ui-radius)*1.5)] focus:outline-none focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2',
linkLeadingIcon: 'size-4 shrink-0',
linkLabel: 'truncate',
linkTrailing: 'ms-auto inline-flex gap-1.5 items-center',
linkTrailingIcon: 'size-5 transform transition-transform duration-200 shrink-0 group-data-expanded:rotate-180',
content: 'overflow-hidden lg:col-span-2 flex flex-col [&>div]:my-0 [&>div]:flex-1 [&>div]:flex [&>div]:flex-col [&>div>div]:border-0 [&>div>pre]:border-b-0 [&>div>pre]:border-s-0 [&>div>pre]:border-e-0 [&>div>pre]:rounded-l-none [&>div>pre]:flex-1 [&>div]:overflow-y-auto'
},
variants: {
active: {
true: {
link: 'text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]'
},
false: {
link: [
'hover:text-[var(--ui-text-highlighted)] hover:before:bg-[var(--ui-bg-elevated)]/50',
'transition-colors before:transition-colors'
]
}
}
}
}
}
}
})
]
})
Collapsible
Wrap your content with the collapsible
component to display a Collapsible in your content.
Prop | Default | Type |
---|---|---|
name | string | |
size | md | string |
color | neutral | string |
::collapsible
| Prop | Default | Type |
|---------|-----------|--------------------------|
| `name` | | `string`{lang="ts-type"} |
| `size` | `md` | `string`{lang="ts-type"} |
| `color` | `neutral` | `string`{lang="ts-type"} |
::
Prop | Default | Type |
---|---|---|
icon |
|
The icon displayed to toggle the collapsible. |
name |
|
The name displayed in the trigger label. |
openText |
|
The text displayed when the collapsible is open. |
closeText |
|
The text displayed when the collapsible is closed. |
ui |
|
export default defineAppConfig({
uiPro: {
prose: {
collapsible: {
slots: {
base: '',
trigger: [
'group relative rounded-[calc(var(--ui-radius)/2)] inline-flex items-center gap-1.5 text-[var(--ui-text-muted)] hover:text-[var(--ui-text)] text-sm focus-visible:ring-2 focus-visible:ring-[var(--ui-primary)] focus:outline-none',
'transition-colors'
],
triggerIcon: 'size-4 shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200',
triggerLabel: 'truncate'
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
collapsible: {
slots: {
base: '',
trigger: [
'group relative rounded-[calc(var(--ui-radius)/2)] inline-flex items-center gap-1.5 text-[var(--ui-text-muted)] hover:text-[var(--ui-text)] text-sm focus-visible:ring-2 focus-visible:ring-[var(--ui-primary)] focus:outline-none',
'transition-colors'
],
triggerIcon: 'size-4 shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200',
triggerLabel: 'truncate'
}
}
}
}
})
]
})
Icon
Use the icon
component to display an Icon in your content.
:icon{name="i-simple-icons-nuxtdotjs"}
Prop | Default | Type |
---|---|---|
name |
|
export default defineAppConfig({
uiPro: {
prose: {
icon: {
base: 'size-4 shrink-0 align-sub'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
icon: {
base: 'size-4 shrink-0 align-sub'
}
}
}
})
]
})
Kbd
Use the kbd
component to display a Kbd in your content.
K
:kbd{value="meta"} :kbd{value="K"}
Prop | Default | Type |
---|---|---|
value |
|
export default defineAppConfig({
uiPro: {
prose: {
kbd: {
base: 'align-text-top'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
kbd: {
base: 'align-text-top'
}
}
}
})
]
})
Tabs
Use the tabs
and tabs-item
components to display Tabs in your content.
::callout
Lorem velit voluptate ex reprehenderit ullamco et culpa.
::
::tabs
:::tabs-item{label="Code" icon="i-lucide-code"}
```mdc
::callout
Lorem velit voluptate ex reprehenderit ullamco et culpa.
::
```
:::
:::tabs-item{label="Preview" icon="i-lucide-eye"}
::callout
Lorem velit voluptate ex reprehenderit ullamco et culpa.
::
:::
::
Prop | Default | Type |
---|---|---|
modelValue |
| |
defaultValue |
|
The default tab to select. |
sync |
Sync the selected tab with a local storage key. | |
hash |
The hash to scroll to when the tab is selected. |
export default defineAppConfig({
uiPro: {
prose: {
tabs: {
slots: {
root: 'my-5'
}
},
tabsItem: {
base: ''
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
tabs: {
slots: {
root: 'my-5'
}
},
tabsItem: {
base: ''
}
}
}
})
]
})
Steps
Wrap your headings with the Steps component to display a list of steps.
Use the level
prop to define which heading will be used for the steps.
Add the Nuxt UI Pro module in your nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nuxt/ui-pro']
})
Import Tailwind CSS and Nuxt UI Pro in your CSS
@import "tailwindcss";
@import "@nuxt/ui-pro";
::steps{level="4"}
#### Add the Nuxt UI Pro module in your `nuxt.config.ts`{lang="ts-type"}
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui-pro']
})
```
#### Import Tailwind CSS and Nuxt UI Pro in your CSS
```css [assets/css/main.css]
@import "tailwindcss";
@import "@nuxt/ui-pro";
```
::
Prop | Default | Type |
---|---|---|
level |
|
|
export default defineAppConfig({
uiPro: {
prose: {
steps: {
base: 'ms-4 border-s border-[var(--ui-border)] ps-8 [counter-reset:step]',
variants: {
level: {
'2': '[&>h2]:[counter-increment:step] [&>h2]:relative [&>h2]:before:absolute [&>h2]:before:size-8 [&>h2]:before:bg-[var(--ui-bg-elevated)] [&>h2]:before:rounded-full [&>h2]:before:font-semibold [&>h2]:before:text-sm [&>h2]:before:tabular-nums [&>h2]:before:inline-flex [&>h2]:before:items-center [&>h2]:before:justify-center [&>h2]:before:ring-4 [&>h2]:before:ring-[var(--ui-bg)] [&>h2]:before:-ms-[48.5px] [&>h2]:before:-mt-0 [&>h2]:before:content-[counter(step)] [&>h2>a>span]:hidden',
'3': '[&>h3]:[counter-increment:step] [&>h3]:relative [&>h3]:before:absolute [&>h3]:before:size-7 [&>h3]:before:inset-x-0.5 [&>h3]:before:bg-[var(--ui-bg-elevated)] [&>h3]:before:rounded-full [&>h3]:before:font-semibold [&>h3]:before:text-sm [&>h3]:before:tabular-nums [&>h3]:before:inline-flex [&>h3]:before:items-center [&>h3]:before:justify-center [&>h3]:before:ring-4 [&>h3]:before:ring-[var(--ui-bg)] [&>h3]:before:-ms-[48.5px] [&>h3]:before:content-[counter(step)] [&>h3>a>span]:hidden',
'4': '[&>h4]:[counter-increment:step] [&>h4]:relative [&>h4]:before:absolute [&>h4]:before:size-7 [&>h4]:before:inset-x-0.5 [&>h4]:before:bg-[var(--ui-bg-elevated)] [&>h4]:before:rounded-full [&>h4]:before:font-semibold [&>h4]:before:text-sm [&>h4]:before:tabular-nums [&>h4]:before:inline-flex [&>h4]:before:items-center [&>h4]:before:justify-center [&>h4]:before:ring-4 [&>h4]:before:ring-[var(--ui-bg)] [&>h4]:before:-ms-[48.5px] [&>h4]:before:content-[counter(step)] [&>h4>a>span]:hidden'
}
},
defaultVariants: {
level: '3'
}
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
prose: {
steps: {
base: 'ms-4 border-s border-[var(--ui-border)] ps-8 [counter-reset:step]',
variants: {
level: {
'2': '[&>h2]:[counter-increment:step] [&>h2]:relative [&>h2]:before:absolute [&>h2]:before:size-8 [&>h2]:before:bg-[var(--ui-bg-elevated)] [&>h2]:before:rounded-full [&>h2]:before:font-semibold [&>h2]:before:text-sm [&>h2]:before:tabular-nums [&>h2]:before:inline-flex [&>h2]:before:items-center [&>h2]:before:justify-center [&>h2]:before:ring-4 [&>h2]:before:ring-[var(--ui-bg)] [&>h2]:before:-ms-[48.5px] [&>h2]:before:-mt-0 [&>h2]:before:content-[counter(step)] [&>h2>a>span]:hidden',
'3': '[&>h3]:[counter-increment:step] [&>h3]:relative [&>h3]:before:absolute [&>h3]:before:size-7 [&>h3]:before:inset-x-0.5 [&>h3]:before:bg-[var(--ui-bg-elevated)] [&>h3]:before:rounded-full [&>h3]:before:font-semibold [&>h3]:before:text-sm [&>h3]:before:tabular-nums [&>h3]:before:inline-flex [&>h3]:before:items-center [&>h3]:before:justify-center [&>h3]:before:ring-4 [&>h3]:before:ring-[var(--ui-bg)] [&>h3]:before:-ms-[48.5px] [&>h3]:before:content-[counter(step)] [&>h3>a>span]:hidden',
'4': '[&>h4]:[counter-increment:step] [&>h4]:relative [&>h4]:before:absolute [&>h4]:before:size-7 [&>h4]:before:inset-x-0.5 [&>h4]:before:bg-[var(--ui-bg-elevated)] [&>h4]:before:rounded-full [&>h4]:before:font-semibold [&>h4]:before:text-sm [&>h4]:before:tabular-nums [&>h4]:before:inline-flex [&>h4]:before:items-center [&>h4]:before:justify-center [&>h4]:before:ring-4 [&>h4]:before:ring-[var(--ui-bg)] [&>h4]:before:-ms-[48.5px] [&>h4]:before:content-[counter(step)] [&>h4>a>span]:hidden'
}
},
defaultVariants: {
level: '3'
}
}
}
}
})
]
})