Svelte Footer - Flowbite
Use the footer section at the bottom of every page to show valuable information to your users, such as sitemap links, a copyright notice, and a logo
The footer is one of the most underestimated sections of a website being located at the very bottom of every page, however, it can be used as a way to try to convince users to stay on your website if they haven’t found the information they’ve been looking for inside the main content area.
Setup #
- Svelte
<script>
import { Footer, FooterBrand, FooterCopyright, FooterIcon, FooterLink, FooterLinkGroup } from 'flowbite-svelte';
</script>
Default footer #
Use this footer component to show a copyright notice and some helpful website links.
- Svelte
<script>
import { Footer, FooterCopyright, FooterLinkGroup, FooterLink } from 'flowbite-svelte';
</script>
<Footer>
<FooterCopyright href="/" by="Flowbite™" year={2022} />
<FooterLinkGroup ulClass="flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0">
<FooterLink href="/">About</FooterLink>
<FooterLink href="/">Privacy Policy</FooterLink>
<FooterLink href="/">Licensing</FooterLink>
<FooterLink href="/">Contact</FooterLink>
</FooterLinkGroup>
</Footer>
Footer with logo #
Use this component to show your brand’s logo, a few website links and the copyright notice on a second row.
- Svelte
<script>
import { Footer, FooterCopyright, FooterLinkGroup, FooterBrand, FooterLink } from 'flowbite-svelte';
</script>
<Footer footerType="logo">
<div class="sm:flex sm:items-center sm:justify-between">
<FooterBrand href="https://flowbite.com" src="/images/flowbite-svelte-icon-logo.svg" alt="Flowbite Logo" name="Flowbite" />
<FooterLinkGroup ulClass="flex flex-wrap items-center mb-6 text-sm text-gray-500 sm:mb-0 dark:text-gray-400">
<FooterLink href="/">About</FooterLink>
<FooterLink href="/">Privacy Policy</FooterLink>
<FooterLink href="/">Licensing</FooterLink>
<FooterLink href="/">Contact</FooterLink>
</FooterLinkGroup>
</div>
<hr class="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" />
<FooterCopyright href="/" by="Flowbite™" />
</Footer>
Social media icons #
This footer component can be used to show your brand’s logo, multiple rows of website links, a copyright notice and social media profile icons including Twitter, Facebook, Instagram, and more.
- Svelte
<script>
import { Footer, FooterCopyright, FooterLinkGroup, FooterLink, FooterBrand, FooterIcon } from 'flowbite-svelte';
import { Icon } from 'flowbite-svelte-icons';
import Dribble from '../../utils/icons/Dribble.svelte';
</script>
<Footer footerType="socialmedia">
<div class="md:flex md:justify-between">
<div class="mb-6 md:mb-0">
<FooterBrand href="https://flowbite.com" src="/images/flowbite-svelte-icon-logo.svg" alt="Flowbite Logo" name="Flowbite" />
</div>
<div class="grid grid-cols-2 gap-8 sm:gap-6 sm:grid-cols-3">
<div>
<h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Resources</h2>
<FooterLinkGroup>
<FooterLink liClass="mb-4" href="/">Flowbite</FooterLink>
<FooterLink liClass="mb-4" href="/">Tailwind CSS</FooterLink>
</FooterLinkGroup>
</div>
<div>
<h2 class="mb-6 text-sm font-semibold uppercase text-gray-900 dark:text-white">Follow us</h2>
<FooterLinkGroup>
<FooterLink liClass="mb-4" href="/">GitHub</FooterLink>
<FooterLink liClass="mb-4" href="/">Discord</FooterLink>
</FooterLinkGroup>
</div>
<div>
<h2 class="mb-6 text-sm font-semibold uppercase text-gray-900 dark:text-white">Legal</h2>
<FooterLinkGroup>
<FooterLink liClass="mb-4" href="/">Privacy Policy</FooterLink>
<FooterLink liClass="mb-4" href="/">Terms & Conditions</FooterLink>
</FooterLinkGroup>
</div>
</div>
</div>
<hr class="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" />
<div class="sm:flex sm:items-center sm:justify-between">
<FooterCopyright href="/" by="Flowbite™" />
<div class="flex mt-4 space-x-6 sm:justify-center sm:mt-0">
<FooterIcon href="/">
<Icon name="facebook-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Icon name="discord-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Icon name="twitter-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Icon name="github-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Dribble />
</FooterIcon>
</div>
</div>
</Footer>
Sitemap links #
If you have a website with many pages you can use this footer component to show a sitemap spanning the entire width of a row followed below by a copyright notice and social media icons.
- Svelte
<script>
import { Footer, FooterLinkGroup, FooterLink, FooterBrand, FooterIcon, FooterCopyright } from 'flowbite-svelte';
import { Icon } from 'flowbite-svelte-icons';
import Dribble from '../../utils/icons/Dribble.svelte';
</script>
<Footer footerType="sitemap">
<div class="grid grid-cols-2 gap-8 py-8 px-6 md:grid-cols-4">
<div>
<h2 class="mb-6 text-sm font-semibold text-gray-400 uppercase">Company</h2>
<FooterLinkGroup ulClass="text-gray-300">
<FooterLink liClass="mb-4" href="/">About</FooterLink>
<FooterLink liClass="mb-4" href="/">Careers</FooterLink>
<FooterLink liClass="mb-4" href="/">Brand Center</FooterLink>
<FooterLink liClass="mb-4" href="/">Blog</FooterLink>
</FooterLinkGroup>
</div>
<div>
<h2 class="mb-6 text-sm font-semibold uppercase text-gray-400">Download</h2>
<FooterLinkGroup ulClass="text-gray-300">
<FooterLink liClass="mb-4" href="/">Discord Server</FooterLink>
<FooterLink liClass="mb-4" href="/">Twitter</FooterLink>
<FooterLink liClass="mb-4" href="/">Facebook</FooterLink>
<FooterLink liClass="mb-4" href="/">Contact Us</FooterLink>
</FooterLinkGroup>
</div>
<div>
<h2 class="mb-6 text-sm font-semibold uppercase text-gray-400">Legal</h2>
<FooterLinkGroup ulClass="text-gray-300">
<FooterLink liClass="mb-4" href="/">Privacy Policy</FooterLink>
<FooterLink liClass="mb-4" href="/">Licensing</FooterLink>
<FooterLink liClass="mb-4" href="/">Terms & Conditions</FooterLink>
</FooterLinkGroup>
</div>
<div>
<h2 class="mb-6 text-sm font-semibold uppercase text-gray-400">Download</h2>
<FooterLinkGroup ulClass="text-gray-300">
<FooterLink liClass="mb-4" href="/">iOS</FooterLink>
<FooterLink liClass="mb-4" href="/">Android</FooterLink>
<FooterLink liClass="mb-4" href="/">Windows</FooterLink>
<FooterLink liClass="mb-4" href="/">MacOS</FooterLink>
</FooterLinkGroup>
</div>
</div>
<div class="py-6 px-4 bg-gray-700 md:flex md:items-center md:justify-between">
<FooterCopyright spanClass="text-sm text-gray-300 sm:text-center" href="/" by="Flowbite™" />
<div class="flex mt-4 space-x-6 sm:justify-center md:mt-0">
<FooterIcon href="/">
<Icon name="facebook-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Icon name="discord-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Icon name="twitter-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Icon name="github-solid" class="w-4 h-4 text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white" />
</FooterIcon>
<FooterIcon href="/">
<Dribble />
</FooterIcon>
</div>
</div>
</Footer>
Sticky footer #
Use this example to set create a sticky footer by using a fixed position to the bottom of the document page as the user scrolls up or down the main content area.
- Svelte
<script>
import { Footer, FooterLinkGroup, FooterLink, ImagePlaceholder, TextPlaceholder, Skeleton, FooterCopyright } from 'flowbite-svelte';
</script>
<div style="height:300px;" class="overflow-scroll pb-16">
<Skeleton class="my-8" />
<ImagePlaceholder class="my-8" />
<TextPlaceholder class="my-8" />
</div>
<Footer class="absolute bottom-0 left-0 z-20 w-full">
<FooterCopyright href="/" by="Flowbite™" year={2022} />
<FooterLinkGroup ulClass="flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0">
<FooterLink href="/">About</FooterLink>
<FooterLink href="/">Privacy Policy</FooterLink>
<FooterLink href="/">Licensing</FooterLink>
<FooterLink href="/">Contact</FooterLink>
</FooterLinkGroup>
</Footer>
Props #
The component has the following props, type, and default values. See types page for type information.
Footer #
- Use the
class
prop to overwrite the default class.
Name | Type | Default |
---|---|---|
footerType | 'sitemap' | 'default' | 'logo' | 'socialmedia' | 'default' |
FooterBrand #
- Use the
classA
prop to overwriteaClass
. - Use the
classSpan
prop to overwritespanClass
. - Use the
classImg
prop to overwriteimgClass
.
Name | Type | Default |
---|---|---|
aClass | string | 'flex items-center' |
spanClass | string | 'self-center text-2xl font-semibold whitespace-nowrap dark:text-white' |
imgClass | string | 'mr-3 h-8' |
href | string | '' |
src | string | '' |
alt | string | '' |
name | string | '' |
target | string | undefined | undefined |
FooterCopyright #
- Use
classSpan
prop to overwriteclassSpan
. - Use
classA
prop to overwriteaClass
.
Name | Type | Default |
---|---|---|
spanClass | string | 'block text-sm text-gray-500 sm:text-center dark:text-gray-400' |
aClass | string | 'hover:underline' |
year | number | new Date().getFullYear() |
href | string | '' |
by | string | '' |
target | string | undefined | undefined |
copyrightMessage | string | 'All Rights Reserved.' |
FooterIcon #
- Use the
class
prop to overwriteaClass
.
Name | Type | Default |
---|---|---|
href | string | '' |
ariaLabel | string | '' |
aClass | string | 'text-gray-500 hover:text-gray-900 dark:hover:text-white' |
target | string | undefined | undefined |
FooterLink #
- Use the
classLi
prop to overwriteliClass
. - Use the
classA
prop to overwriteaClass
.
Name | Type | Default |
---|---|---|
liClass | string | 'mr-4 last:mr-0 md:mr-6' |
aClass | string | 'hover:underline' |
href | string | '' |
target | string | undefined | undefined |
FooterLinkGroup #
- Use the
class
prop to overwriteulClass
.
Name | Type | Default |
---|---|---|
ulClass | string | 'text-gray-600 dark:text-gray-400' |