Footer — Compact Bar
nswds-ui/footer-compactFreeBlock
A single horizontal row of logo, links, ownership and social, for embedded tools and admin screens. Omits acknowledgement of Country by design.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/footer-compact.jsonSource
1import type * as React from 'react'23import { Footer, FooterNavLink, FooterSmallPrint } from '@/components/footer'4import { Logo } from '@/components/logo'56// ── Sample content — replace with your service's own ────────────────────────7const legalLinksSample = [8 { name: 'Accessibility', href: '#accessibility' },9 { name: 'Privacy', href: '#privacy' },10 { name: 'Copyright', href: '#copyright' },11]1213const departmentSample = 'Digital NSW'1415type FooterCompactProps = Omit<16 React.ComponentProps<typeof Footer>,17 'acknowledgement' | 'children' | 'smallPrint'18>1920/**21 * A single horizontal bar: logo, inline links, then ownership and social. The22 * shortest footer in the set, for embedded tools, dashboards and admin screens23 * where the footer should take almost no vertical space.24 *25 * NOTE — this is the one block that omits acknowledgement of Country: it26 * cannot be shown respectfully in a one-line bar. A service using this footer27 * must carry the acknowledgement elsewhere on the page. If there is nowhere28 * else for it, use `FooterSimpleCentred` instead.29 */30export function FooterCompact({31 legalLinks = legalLinksSample,32 socialLinks,33 department = departmentSample,34 year,35 ...props36}: FooterCompactProps) {37 return (38 <Footer {...props} acknowledgement={false} smallPrint={false}>39 <div className='flex items-center py-2 max-lg:flex-col max-lg:gap-4 lg:flex-row lg:gap-8'>40 <Logo className='h-8 w-auto shrink-0' />41 {/* Labelled because this nav sits alongside the site's other landmarks;42 "Footer" distinguishes it in a screen reader's landmark list. */}43 <nav44 aria-label='Footer'45 className='flex flex-wrap gap-x-4 gap-y-2 text-sm max-lg:justify-center lg:justify-start'46 >47 {legalLinks.map((item) => (48 <FooterNavLink key={item.name} href={item.href}>49 {item.name}50 </FooterNavLink>51 ))}52 </nav>53 <FooterSmallPrint54 department={department}55 socialLinks={socialLinks}56 year={year}57 // pt-0 removes the stacked-layout spacing: in this bar the row is the58 // layout, not a section below one.59 className='gap-4 pt-0 lg:ml-auto'60 />61 </div>62 </Footer>63 )64}
What it pulls in
Other registry items
Files it writes
More from @nswds/ui
All 46 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Footer — Collapsible Site Mapfooter-accordion | @nswds/ui | Blocks | Free | no deps | |
| Footer — Contact Detailsfooter-contact | @nswds/ui | Blocks | Free | no deps | |
| Footer — Call to Actionfooter-cta | @nswds/ui | Blocks | Free | no deps | |
| Footer — Newsletterfooter-newsletter | @nswds/ui | Blocks | Free | no deps | |
| Footer — Simple Centredfooter-simple-centred | @nswds/ui | Blocks | Free | no deps | |
| Footer — Site Mapfooter-sitemap | @nswds/ui | Blocks | Free | no deps | |
| Footer — Site Map with Brandfooter-sitemap-brand | @nswds/ui | Blocks | Free | no deps | |
| Forgot Password Formforgot-password-form | @nswds/ui | Blocks | Free | no deps |
