FooterColumns
Usage
The FooterColumns component renders a list of columns to display in your Footer.
Use it in the top
slot of the Footer component:
<template>
<UFooter>
<template #top>
<UContainer>
<UFooterColumns />
</UContainer>
</template>
</UFooter>
</template>
Columns
Use the columns
prop as an array of objects with the following properties:
label: string
children?: { label: string, icon?: string }[]
You can pass any property from the Link component such as to
, target
, etc.
<script setup lang="ts">
const columns = [
{
label: 'Community',
children: [
{
label: 'Nuxters',
to: 'https://nuxters.nuxt.com',
target: '_blank'
},
{
label: 'Video Courses',
to: 'https://masteringnuxt.com/nuxt3?ref=nuxt',
target: '_blank'
},
{
label: 'Nuxt on GitHub',
to: 'https://github.com/nuxt',
target: '_blank'
}
]
},
{
label: 'Solutions',
children: [
{
label: 'Nuxt Content',
to: 'https://content.nuxt.com/',
target: '_blank'
},
{
label: 'Nuxt DevTools',
to: 'https://devtools.nuxt.com/',
target: '_blank'
},
{
label: 'Nuxt Image',
to: 'https://image.nuxt.com/',
target: '_blank'
},
{
label: 'Nuxt UI',
to: 'https://ui.nuxt.com/',
target: '_blank'
}
]
}
]
</script>
<template>
<UFooterColumns :columns="columns">
<template #right>
<UFormField name="email" label="Subscribe to our newsletter" size="lg">
<UInput type="email" class="w-full">
<template #trailing>
<UButton type="submit" size="xs" color="neutral" label="Subscribe" />
</template>
</UInput>
</UFormField>
</template>
</UFooterColumns>
</template>
API
Props
Prop | Default | Type |
---|---|---|
as |
|
The element or component this component should render as. |
links |
| |
ui |
|
Slots
Slot | Type |
---|---|
left |
|
default |
|
right |
|
link |
|
link-leading |
|
link-label |
|
link-trailing |
|
Theme
export default defineAppConfig({
uiPro: {
footerColumns: {
slots: {
root: 'xl:grid xl:grid-cols-3 xl:gap-8',
left: 'mb-10 xl:mb-0',
center: 'flex flex-col lg:grid grid-flow-col auto-cols-fr gap-8 xl:col-span-2',
right: 'mt-10 xl:mt-0',
label: 'text-sm/6 font-semibold',
list: 'mt-6 space-y-4',
item: 'relative',
link: 'group text-sm flex items-center gap-1.5 focus-visible:outline-[var(--ui-primary)]',
linkLeadingIcon: 'size-5 shrink-0',
linkLabel: 'truncate',
linkLabelExternalIcon: 'size-3 absolute top-0 text-[var(--ui-text-dimmed)]'
},
variants: {
active: {
true: {
link: 'text-[var(--ui-primary)] font-medium'
},
false: {
link: [
'text-[var(--ui-text-muted)] hover:text-[var(--ui-text)]',
'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: {
footerColumns: {
slots: {
root: 'xl:grid xl:grid-cols-3 xl:gap-8',
left: 'mb-10 xl:mb-0',
center: 'flex flex-col lg:grid grid-flow-col auto-cols-fr gap-8 xl:col-span-2',
right: 'mt-10 xl:mt-0',
label: 'text-sm/6 font-semibold',
list: 'mt-6 space-y-4',
item: 'relative',
link: 'group text-sm flex items-center gap-1.5 focus-visible:outline-[var(--ui-primary)]',
linkLeadingIcon: 'size-5 shrink-0',
linkLabel: 'truncate',
linkLabelExternalIcon: 'size-3 absolute top-0 text-[var(--ui-text-dimmed)]'
},
variants: {
active: {
true: {
link: 'text-[var(--ui-primary)] font-medium'
},
false: {
link: [
'text-[var(--ui-text-muted)] hover:text-[var(--ui-text)]',
'transition-colors'
]
}
}
}
}
}
})
]
})