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.
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.
| Name | Type | Default | Description |
|---|---|---|---|
brand | ReactNode | – | The logo, as a link home. |
columnsrequired | readonly SiteFooterColumn[] | – | |
description | ReactNode | – | A line under the brand. |
legal | ReactNode | – | The legal row: the name, the version, Privacy and Terms. |
render | RenderProp<Record<string, never>> | – | Must render a |
- Also takes every attribute of
<footer>exceptchildren. (Omit<ComponentPropsWithRef<"footer">, "children">)
render takes an element, or, in client code, a function of the props and no state.
Other exports
SiteFooterColumntypeimport type { SiteFooterColumn } from '@nizivo/react/unstable/site-footer'One column: "Product" and its links.
Name Type Default Description linksrequiredreadonly SiteFooterLink[]– titlerequiredstring– SiteFooterLinktypeimport type { SiteFooterLink } from '@nizivo/react/unstable/site-footer'One link in a column.
Name Type Default Description hrefrequiredstring– labelrequiredReactNode– SiteFooterPropstypeimport 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.
| Slot | Rendered by | Data attributes |
|---|---|---|
site-footer.nz-site-footer | SiteFooterroot (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.
Sidebar
The app's main navigation on screens 640 px and wider, with the store at the top, the destinations, and Settings at the foot. It is 264 px wide from 1280 px and folds to a 72 px icon rail below that, where each destination's Tooltip names it.
SiteNavbar
Unstable: a website's main navigation, the brand, the links and the actions, as a full-width bar or a floating glass pill; below 768 px the links fold into a menu. Import it from @nizivo/react/unstable/site-navbar.