PaginaSectie
Gebruik
De PageSection-component verpakt uw inhoud in een Container met behoud van flexibiliteit over de volledige breedte, waardoor het gemakkelijk is om achtergrondkleuren, afbeeldingen of patronen toe te voegen. Het biedt een flexibele manier om inhoud weer te geven met een illustratie in de standaardsleuf.
Beautiful Vue UI components
Gebruik het na een PageHero component:
<template>
<UPageHero />
<UPageSection />
</template>
Titel
Gebruik de title prop om de titel van de sectie in te stellen.
Beautiful Vue UI components
<template>
<UPageSection title="Beautiful Vue UI components" />
</template>Beschrijving
Gebruik de description prop om de beschrijving van de sectie in te stellen.
Beautiful Vue UI components
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
/>
</template>Kop
Gebruik de headline prop om de kop van de sectie in te stellen.
Beautiful Vue UI components
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
headline="Features"
/>
</template>Icoon
Gebruik de icon prop om het pictogram van de sectie in te stellen.
Beautiful Vue UI components
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
icon="i-lucide-rocket"
/>
</template>Functies
Gebruik de features prop om een lijst met PageFeature onder de beschrijving weer te geven als een array van objecten met de volgende eigenschappen:
title?: stringdescription?: stringicon?: stringorientation?: 'horizontal' | 'vertical'
U kunt elke eigenschap van de Link component zoals to, target, etc.
Beautiful Vue UI components
<script setup lang="ts">
import type { PageFeatureProps } from '@nuxt/ui'
const features = ref<PageFeatureProps[]>([
{
title: 'Icons',
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.',
icon: 'i-lucide-smile',
to: '/docs/getting-started/integrations/icons'
},
{
title: 'Fonts',
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.',
icon: 'i-lucide-a-large-small',
to: '/docs/getting-started/integrations/fonts'
},
{
title: 'Color Mode',
description: 'Nuxt UI integrates with Nuxt Color Mode to switch between light and dark.',
icon: 'i-lucide-sun-moon',
to: '/docs/getting-started/integrations/color-mode'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
:features="features"
/>
</template><script setup lang="ts">
import { ref, provide } from 'vue'
import type { PageFeatureProps } from '@nuxt/ui'
const features = ref<PageFeatureProps[]>([
{
title: 'Icons',
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.',
icon: 'i-lucide-smile',
to: '/docs/getting-started/integrations/icons'
},
{
title: 'Fonts',
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.',
icon: 'i-lucide-a-large-small',
to: '/docs/getting-started/integrations/fonts'
},
{
title: 'Color Mode',
description: 'Nuxt UI integrates with Nuxt Color Mode to switch between light and dark.',
icon: 'i-lucide-sun-moon',
to: '/docs/getting-started/integrations/color-mode'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
:features="features"
/>
</template>Links
Gebruik de links prop om een lijst met Button onder de beschrijving weer te geven.
Beautiful Vue UI components
<script setup lang="ts">
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
to: '/docs/getting-started',
icon: 'i-lucide-square-play',
color: 'neutral'
},
{
label: 'Explore components',
to: '/docs/components/app',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
:links="links"
/>
</template><script setup lang="ts">
import { ref } from 'vue'
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
to: '/docs/getting-started',
icon: 'i-lucide-square-play',
color: 'neutral'
},
{
label: 'Explore components',
to: '/docs/components/app',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
:links="links"
/>
</template>Oriëntatie
Gebruik de orientation-prop om de oriëntatie met de standaardsleuf te wijzigen. Standaard vertical.
Beautiful Vue UI components
<script setup lang="ts">
import type { PageFeatureProps, ButtonProps } from '@nuxt/ui'
const features = ref<PageFeatureProps[]>([
{
title: 'Icons',
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.',
icon: 'i-lucide-smile',
to: '/docs/getting-started/integrations/icons'
},
{
title: 'Fonts',
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.',
icon: 'i-lucide-a-large-small',
to: '/docs/getting-started/integrations/fonts'
},
{
title: 'Color Mode',
description: 'Nuxt UI integrates with Nuxt Color Mode to switch between light and dark.',
icon: 'i-lucide-sun-moon',
to: '/docs/getting-started/integrations/color-mode'
}
])
const links = ref<ButtonProps[]>([
{
label: 'Explore components',
to: '/docs/components/app',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
icon="i-lucide-rocket"
orientation="horizontal"
:features="features"
:links="links"
>
<img
src="https://picsum.photos/704/1294"
width="352"
height="647"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageSection>
</template><script setup lang="ts">
import { ref, provide } from 'vue'
import type { PageFeatureProps, ButtonProps } from '@nuxt/ui'
const features = ref<PageFeatureProps[]>([
{
title: 'Icons',
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.',
icon: 'i-lucide-smile',
to: '/docs/getting-started/integrations/icons'
},
{
title: 'Fonts',
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.',
icon: 'i-lucide-a-large-small',
to: '/docs/getting-started/integrations/fonts'
},
{
title: 'Color Mode',
description: 'Nuxt UI integrates with Nuxt Color Mode to switch between light and dark.',
icon: 'i-lucide-sun-moon',
to: '/docs/getting-started/integrations/color-mode'
}
])
const links = ref<ButtonProps[]>([
{
label: 'Explore components',
to: '/docs/components/app',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
icon="i-lucide-rocket"
orientation="horizontal"
:features="features"
:links="links"
>
<img
src="https://picsum.photos/704/1294"
width="352"
height="647"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageSection>
</template>Omkeren
Gebruik de reverse prop om de oriëntatie van de standaardsleuf om te keren.
Beautiful Vue UI components
<script setup lang="ts">
import type { PageFeatureProps, ButtonProps } from '@nuxt/ui'
const features = ref<PageFeatureProps[]>([
{
title: 'Icons',
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.',
icon: 'i-lucide-smile',
to: '/docs/getting-started/integrations/icons'
},
{
title: 'Fonts',
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.',
icon: 'i-lucide-a-large-small',
to: '/docs/getting-started/integrations/fonts'
},
{
title: 'Color Mode',
description: 'Nuxt UI integrates with Nuxt Color Mode to switch between light and dark.',
icon: 'i-lucide-sun-moon',
to: '/docs/getting-started/integrations/color-mode'
}
])
const links = ref<ButtonProps[]>([
{
label: 'Explore components',
to: '/docs/components/app',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
icon="i-lucide-rocket"
orientation="horizontal"
reverse
:features="features"
:links="links"
>
<img
src="https://picsum.photos/704/1294"
width="352"
height="647"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageSection>
</template><script setup lang="ts">
import { ref, provide } from 'vue'
import type { PageFeatureProps, ButtonProps } from '@nuxt/ui'
const features = ref<PageFeatureProps[]>([
{
title: 'Icons',
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.',
icon: 'i-lucide-smile',
to: '/docs/getting-started/integrations/icons'
},
{
title: 'Fonts',
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.',
icon: 'i-lucide-a-large-small',
to: '/docs/getting-started/integrations/fonts'
},
{
title: 'Color Mode',
description: 'Nuxt UI integrates with Nuxt Color Mode to switch between light and dark.',
icon: 'i-lucide-sun-moon',
to: '/docs/getting-started/integrations/color-mode'
}
])
const links = ref<ButtonProps[]>([
{
label: 'Explore components',
to: '/docs/components/app',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageSection
title="Beautiful Vue UI components"
description="Nuxt UI provides a comprehensive suite of components and utilities to help you build beautiful and accessible web applications with Vue and Nuxt."
icon="i-lucide-rocket"
orientation="horizontal"
reverse
:features="features"
:links="links"
>
<img
src="https://picsum.photos/704/1294"
width="352"
height="647"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageSection>
</template>API
Props
| Prop | Default | Type |
|---|---|---|
as | 'section' | anyThe element or component this component should render as. |
headline | stringThe headline displayed above the title. | |
icon | anyThe icon displayed above the title. | |
title | string | |
description | string | |
links | ButtonProps[]Display a list of Button under the description.
| |
features | PageFeatureProps[]Display a list of PageFeature under the description. | |
orientation | 'vertical' | "vertical" | "horizontal"The orientation of the section. |
reverse | false | boolean Reverse the order of the default slot. |
ui | { root?: SlotClass; container?: SlotClass; wrapper?: SlotClass; header?: SlotClass; leading?: SlotClass; leadingIcon?: SlotClass; headline?: SlotClass; title?: SlotClass; description?: SlotClass; body?: SlotClass; features?: SlotClass; footer?: SlotClass; links?: SlotClass; } |
Slots
| Slot | Type |
|---|---|
top | {} |
header | {} |
leading | { ui: object; } |
headline | {} |
title | {} |
description | {} |
body | {} |
features | {} |
footer | {} |
links | {} |
default | {} |
bottom | {} |
Thema
export default defineAppConfig({
ui: {
pageSection: {
slots: {
root: 'relative isolate',
container: 'flex flex-col lg:grid py-16 sm:py-24 lg:py-32 gap-8 sm:gap-16',
wrapper: '',
header: '',
leading: 'flex items-center mb-6',
leadingIcon: 'size-10 shrink-0 text-primary',
headline: 'mb-3',
title: 'text-3xl sm:text-4xl lg:text-5xl text-pretty tracking-tight font-bold text-highlighted',
description: 'text-base sm:text-lg text-muted',
body: 'mt-8',
features: 'grid',
footer: 'mt-8',
links: 'flex flex-wrap gap-x-6 gap-y-3'
},
variants: {
orientation: {
horizontal: {
container: 'lg:grid-cols-2 lg:items-center',
description: 'text-pretty',
features: 'gap-4'
},
vertical: {
container: '',
headline: 'justify-center',
leading: 'justify-center',
title: 'text-center',
description: 'text-center text-balance',
links: 'justify-center',
features: 'sm:grid-cols-2 lg:grid-cols-3 gap-8'
}
},
reverse: {
true: {
wrapper: 'order-last'
}
},
headline: {
true: {
headline: 'font-semibold text-primary flex items-center gap-1.5'
}
},
title: {
true: {
description: 'mt-6'
}
},
description: {
true: ''
},
body: {
true: ''
}
},
compoundVariants: [
{
orientation: 'vertical',
title: true,
class: {
body: 'mt-16'
}
},
{
orientation: 'vertical',
description: true,
class: {
body: 'mt-16'
}
},
{
orientation: 'vertical',
body: true,
class: {
footer: 'mt-16'
}
}
]
}
}
})import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
ui: {
pageSection: {
slots: {
root: 'relative isolate',
container: 'flex flex-col lg:grid py-16 sm:py-24 lg:py-32 gap-8 sm:gap-16',
wrapper: '',
header: '',
leading: 'flex items-center mb-6',
leadingIcon: 'size-10 shrink-0 text-primary',
headline: 'mb-3',
title: 'text-3xl sm:text-4xl lg:text-5xl text-pretty tracking-tight font-bold text-highlighted',
description: 'text-base sm:text-lg text-muted',
body: 'mt-8',
features: 'grid',
footer: 'mt-8',
links: 'flex flex-wrap gap-x-6 gap-y-3'
},
variants: {
orientation: {
horizontal: {
container: 'lg:grid-cols-2 lg:items-center',
description: 'text-pretty',
features: 'gap-4'
},
vertical: {
container: '',
headline: 'justify-center',
leading: 'justify-center',
title: 'text-center',
description: 'text-center text-balance',
links: 'justify-center',
features: 'sm:grid-cols-2 lg:grid-cols-3 gap-8'
}
},
reverse: {
true: {
wrapper: 'order-last'
}
},
headline: {
true: {
headline: 'font-semibold text-primary flex items-center gap-1.5'
}
},
title: {
true: {
description: 'mt-6'
}
},
description: {
true: ''
},
body: {
true: ''
}
},
compoundVariants: [
{
orientation: 'vertical',
title: true,
class: {
body: 'mt-16'
}
},
{
orientation: 'vertical',
description: true,
class: {
body: 'mt-16'
}
},
{
orientation: 'vertical',
body: true,
class: {
footer: 'mt-16'
}
}
]
}
}
})
]
})