Footer
A responsive footer for your site links and legal notices.
Usage
The Footer component renders a <footer> element.
Use the left, default and right slots to customize the footer.
<script setup lang="ts">
import type { NavigationMenuItem } from 'pohon-ui'
const items: Array<NavigationMenuItem> = [
{
label: 'Theme Studio',
to: '/theme',
target: '_blank'
},
{
label: 'Playground',
to: 'https://play-pohon.vinicunca.dev/',
target: '_blank'
},
{
label: 'Releases',
to: 'https://github.com/vinicunca/pohon/releases',
target: '_blank'
}
]
</script>
<template>
<PFooter>
<template #left>
<p class="text-sm color-text-muted">Copyright © {{ new Date().getFullYear() }}</p>
</template>
<PNavigationMenu :items="items" variant="link" />
<template #right>
<PButton
icon="i-simple-icons-github"
color="neutral"
variant="ghost"
to="https://github.com/vinicunca/pohon/discussions"
target="_blank"
aria-label="Discussions"
/>
<PButton
icon="i-lucide-book-open"
color="neutral"
variant="ghost"
to="https://pohon.vinicunca.dev/"
target="_blank"
aria-label="Documentation"
/>
<PButton
icon="i-simple-icons-github"
color="neutral"
variant="ghost"
to="https://github.com/vinicunca/pohon"
target="_blank"
aria-label="GitHub"
/>
</template>
</PFooter>
</template>In this example, we use the NavigationMenu component to render the footer links in the center.
Examples
Within app.vue
Use the Footer component in your app.vue or in a layout:
app.vue
<script setup lang="ts">
import type { NavigationMenuItem } from 'pohon-ui';
const items: Array<NavigationMenuItem> = [{
label: 'Theme Studio',
to: '/theme',
target: '_blank'
}, {
label: 'Playground',
to: 'https://play-pohon.vinicunca.dev/',
target: '_blank'
}, {
label: 'Releases',
to: 'https://github.com/vinicunca/pohon/releases',
target: '_blank'
}];
</script>
<template>
<PApp>
<PHeader />
<PMain>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</PMain>
<PSeparator
icon="i-lucide-leaf"
type="dashed"
class="h-px"
/>
<PFooter>
<template #left>
<p class="text-sm color-text-muted">
Copyright © {{ new Date().getFullYear() }}
</p>
</template>
<PNavigationMenu
:items="items"
variant="link"
/>
<template #right>
<PButton
icon="i-simple-icons-github"
color="neutral"
variant="ghost"
to="https://github.com/vinicunca/pohon/discussions"
target="_blank"
aria-label="Discussions"
/>
<PButton
icon="i-lucide-book-open"
color="neutral"
variant="ghost"
to="https://vinicunca.dev/"
target="_blank"
aria-label="Documentation"
/>
<PButton
icon="i-simple-icons-github"
color="neutral"
variant="ghost"
to="https://github.com/vinicunca/pohon"
target="_blank"
aria-label="GitHub"
/>
</template>
</PFooter>
</PApp>
</template>
In this example, we use the Separator component to add a border above the footer.
API
Props
| Prop | Default | Type |
|---|---|---|
as | 'footer' | anyThe element or component this component should render as. |
ui | { root?: SlotClass; top?: SlotClass; bottom?: SlotClass; container?: SlotClass; left?: SlotClass; center?: SlotClass; right?: SlotClass; } |
Slots
| Slot | Type |
|---|---|
left | {} |
default | {} |
right | {} |
top | {} |
bottom | {} |
Theme
app.config.ts
export default defineAppConfig({
ui: {
footer: {
slots: {
root: '',
top: 'py-8 lg:py-12',
bottom: 'py-8 lg:py-12',
container: 'py-8 lg:py-4 lg:flex lg:gap-x-3 lg:items-center lg:justify-between',
left: 'mt-3 flex gap-x-1.5 items-center justify-center lg:mt-0 lg:flex-1 lg:justify-start lg:order-1',
center: 'mt-3 flex items-center justify-center lg:mt-0 lg:order-2',
right: 'flex gap-x-1.5 items-center justify-center lg:flex-1 lg:justify-end lg:order-3'
}
}
}
})vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from 'pohon-ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
ui: {
footer: {
slots: {
root: '',
top: 'py-8 lg:py-12',
bottom: 'py-8 lg:py-12',
container: 'py-8 lg:py-4 lg:flex lg:gap-x-3 lg:items-center lg:justify-between',
left: 'mt-3 flex gap-x-1.5 items-center justify-center lg:mt-0 lg:flex-1 lg:justify-start lg:order-1',
center: 'mt-3 flex items-center justify-center lg:mt-0 lg:order-2',
right: 'flex gap-x-1.5 items-center justify-center lg:flex-1 lg:justify-end lg:order-3'
}
}
}
})
]
})Changelog
No recent changes