Skip to content

Footer component

components specs/components/footer.kmd

The page's closing `contentinfo` region — labelled columns of links, an optional social row, a legal/institutional line, and a brand signature. Three variants (landing / app / doc-site) share one structure; columns collapse to a stacked / accordion form on Compact widths. gov.br ships a first-class `footer`; KDS had footers implicit in the landing specs and the generated doc-site — this makes the structure a component.

When this spec applies

Primary triggers

All triggers

Specification body

Footer

R1 — Anatomy

A <footer> (the page's contentinfo landmark) with, top to bottom:

  • Link column groups — one or more labelled columns, each a heading + a list of links (Docs / API / product areas / institutional). Laid on the column grid (column-grid.kmd).
  • Social row (optional) — a row of icon links to external presences, each with an accessible name.
  • Legal / institutional line — copyright (© <year> Koder. All rights reserved.), legal links (privacy, terms), and, for an institutional/gov surface, the org signature.
  • Brand signature (optional) — the wordmark/logo, linking home.

Separated from the page by border-top: 1px solid var(--border); padded (landing default 40px 24px, scaling with the window-size class).

R2 — Variants

VariantShape
landingThe rich form: multi-column link groups + social + legal + brand. The simple two-part form (left copyright / right product links) in landing-pages/products.kmd §7 is the minimal landing footer; the multi-column is the institutional one.
appCompact: legal line + version + a short link set (help, status). No marketing columns.
doc-siteThe generated KDS/ds site footer (layout.templ): a "generated by … from …" line + about / feed / brand-assets links + the feedback widget.

R3 — Responsive collapse

The link columns follow the window-size classes (window-size-classes.kmd): full side-by-side columns on Expanded+, and on Compact they stack — or, for a dense footer, collapse into accordions (one expandable section per column heading). The legal line stays visible (not collapsed) at every width.

R4 — Accessibility

  • The root is a <footer> → the contentinfo landmark (one per page).
  • Each link column is a labelled group — its heading is a real heading, and a navigational column MAY be a <nav> with an aria-label.
  • Social/icon links carry an accessible name (not just an icon).
  • Collapsed accordions (R3) expose expanded/collapsed state to AT and are keyboard-operable (Enter/Space on the heading).

R5 — Content rules (defer to the landing specs)

What goes in a landing footer — and what MUST NOT — is owned by the landing-pages specs, not this component. In particular: a public landing footer never links the source repository / Koder Flow / any code host (products.kmd privacy rule). This component fixes the STRUCTURE; the landing spec fixes the CONTENT.

R6 — gov.br parity

Satisfies the gov.br footer (govbr-ds-parity): collapsible link columns + social + legal/institutional. The KDS institutional landing footer is the parity surface.

Não-escopo / follow-up

  • Adoption — upgrading the existing simple landing footer (products.kmd §7) and the app layouts onto this component's multi-column/collapsible structure is an incremental sweep (stack#448, opened). The doc-site footer already exists.
  • Theme toggle / language toggle that sometimes sit near the footer — those are their own components (themes/light-dark.kmd, i18n/contract.kmd), not footer structure.

Requirements (testable)

The footer SHALL render as a single <footer> element exposing the contentinfo landmark, containing at minimum one or more labelled link column groups, and it SHALL be visually separated from the page content by a top border (border-top: 1px solid var(--border)).

  • GIVEN a page that renders the footer component
  • WHEN the accessibility tree is inspected
  • THEN exactly one contentinfo landmark is present on the page
  • AND that landmark is the root <footer> element
  • GIVEN a footer rendered at the landing default padding
  • WHEN its computed style is measured
  • THEN border-top resolves to 1px solid var(--border)
  • AND the footer contains at least one labelled link column group

The footer SHALL support three variants — landing, app, and doc-site — where the landing variant SHALL present multi-column link groups (with optional social, legal, and brand rows), and the app variant SHALL present a compact legal line plus version and a short link set with NO marketing columns.

Scenario: Landing variant renders rich multi-column form

  • GIVEN the footer is rendered with variant landing in its institutional (multi-column) form
  • WHEN the footer is inspected
  • THEN more than one labelled link column group is present
  • AND a legal/institutional line is present

Scenario: App variant omits marketing columns

  • GIVEN the footer is rendered with variant app
  • WHEN the footer is inspected
  • THEN a legal line and a version string are present
  • AND no marketing link column groups are rendered

On Compact window-size widths the footer SHALL collapse its link columns into a stacked layout or, for a dense footer, into accordions (one expandable section per column heading), while the legal line SHALL remain visible and uncollapsed at every width.

Scenario: Columns stack on Compact width

  • GIVEN a landing footer with multiple link columns laid side-by-side at Expanded width
  • WHEN the viewport is resized to a Compact window-size class
  • THEN the link columns are stacked vertically rather than laid side-by-side
  • AND the legal line remains visible and is not collapsed
  • GIVEN a dense footer whose columns collapse into accordions on Compact
  • WHEN the viewport is at a Compact window-size class with all accordions collapsed
  • THEN the legal line is still rendered and visible

Each link column SHALL be a labelled group whose heading is a real heading element, every social/icon link SHALL carry an accessible name rather than an icon alone, and any collapsed accordion (R3) SHALL expose its expanded/collapsed state to assistive technology and be operable via Enter and Space on the heading.

  • GIVEN a footer with a social row of icon links
  • WHEN each social link's accessible name is computed
  • THEN every social link has a non-empty accessible name
  • AND the name is not derived solely from the icon glyph

Scenario: Accordion heading toggles state via keyboard

  • GIVEN a Compact-width footer whose columns are accordions and one accordion is collapsed
  • WHEN the accordion heading is focused and the Enter or Space key is pressed
  • THEN the accordion expands and its expanded/collapsed state (e.g. aria-expanded) updates to reflect the new state

A public landing footer SHALL NOT link the source repository, Koder Flow, or any code host, deferring all landing content rules to the landing-pages specs while this component fixes only the structure.

  • GIVEN a footer rendered with variant landing on a public landing page
  • WHEN every link href in the footer is enumerated
  • THEN no link points to Koder Flow, the source repository, or any code host

References