Skip to content
Get started

Components

SiteFooter

Unstable: closes every page with the brand, columns of links and the legal row; narrow, it stacks. Import it from @nizivo/react/unstable/site-footer.

Server component, no client JSUnstable

Examples

Basic

A footer: the brand, three columns and the legal row.

import type { JSX } from 'react';
import { Link } from '@nizivo/react/unstable/link';
import { SiteFooter } from '@nizivo/react/unstable/site-footer';

export function SiteFooterExample(): JSX.Element {
  return (
    <SiteFooter
      brand={<Link href="/">Nizivo</Link>}
      description="Calm, accessible product UI from one set of tokens."
      columns={[
        {
          title: 'Product',
          links: [
            { label: 'Components', href: '/docs/components/' },
            { label: 'Patterns', href: '/docs/patterns/' },
            { label: 'Changelog', href: '/changelog/' },
          ],
        },
        {
          title: 'Resources',
          links: [
            { label: 'Getting started', href: '/docs/getting-started/' },
            { label: 'Accessibility', href: '/docs/accessibility/' },
            { label: 'Tokens', href: '/docs/tokens/' },
          ],
        },
        {
          title: 'Company',
          links: [
            { label: 'About', href: '/about/' },
            { label: 'Contact', href: '/contact/' },
          ],
        },
      ]}
      legal={
        <>
          <span>Nizivo · v0.6</span>
          <span>
            <a href="/privacy/">Privacy</a> · <a href="/terms/">Terms</a>
          </span>
        </>
      }
    />
  );
}

Import

import { SiteFooter } from '@nizivo/react/unstable/site-footer';

// Once per app (Getting started), after
// @nizivo/tokens/tokens.css and @nizivo/react/css/base.css
import '@nizivo/react/css/site-footer.css';

Static or interactive

Server. No client JavaScript. How to choose.

Use

It is a <footer>. brand is the logo (a link home) and description a line under it. Each of columns (a title and its links) is a <nav> named by its heading. legal holds the name, the version and the Privacy and Terms links. When narrow, the brand and the columns wrap and stack, following their container, not the window.

Props

Server component Renders data-slot="site-footer" with the class nz-site-footer. Props: SiteFooterProps. Source: src/unstable/site-footer/site-footer.tsx.

NameTypeDefaultDescription
brandReactNode–

The logo, as a link home.

columnsrequiredreadonly SiteFooterColumn[]–
descriptionReactNode–

A line under the brand.

legalReactNode–

The legal row: the name, the version, Privacy and Terms.

renderRenderProp<Record<string, never>>–

Must render a <footer>.

  • Also takes every attribute of <footer> except children. (Omit<ComponentPropsWithRef<"footer">, "children">)

render takes an element, or, in client code, a function of the props and no state.

Other exports

SiteFooterColumn type

import type { SiteFooterColumn } from '@nizivo/react/unstable/site-footer'

One column: "Product" and its links.

NameTypeDefaultDescription
linksrequiredreadonly SiteFooterLink[]–
titlerequiredstring–
SiteFooterLink type

import type { SiteFooterLink } from '@nizivo/react/unstable/site-footer'

One link in a column.

NameTypeDefaultDescription
hrefrequiredstring–
labelrequiredReactNode–
SiteFooterProps type

import type { SiteFooterProps } from '@nizivo/react/unstable/site-footer'

The props of SiteFooter, listed above.

Data attributes and slots

Style parts by class (.nz-<slot>) and state by data attribute. Attribute meanings come from contracts/vocabulary.json.

SlotRendered byData attributes
site-footer
.nz-site-footer
SiteFooter
root (takes render)
none

CSS hooks

Set a hook on the component's class or any ancestor to restyle it without specificity games; leave it unset for the default shown.

This stylesheet reads no public hook.

Layers: nz.components. Classes: .nz-site-footer, .nz-site-footer-brand, .nz-site-footer-column, .nz-site-footer-description, .nz-site-footer-heading, .nz-site-footer-legal, .nz-site-footer-link, .nz-site-footer-links, .nz-site-footer-top.

Tokens this stylesheet reads (15)

--nz-bg-canvas, --nz-border-subtle, --nz-border-width-default, --nz-font-body-m, --nz-font-body-s, --nz-font-label-m-strong, --nz-radius-xs, --nz-space-10, --nz-space-12, --nz-space-3, --nz-space-4, --nz-space-6, --nz-space-8, --nz-text-primary, --nz-text-secondary

Accessibility

Nothing in this component takes focus or keyboard input.

Keyboard

None.

On this page