Page Tabs
FFG-native page-level tab bar — an underlined tablist that collapses into a select below the sm breakpoint.
Installation
pnpm dlx shadcn@latest add @ffg/page-tabsUsage
import { useState } from "react";
import { PageTabs } from "@/components/ui/page-tabs";
const [active, setActive] = useState("overview");
<PageTabs
tabs={[
{ id: "overview", label: "Overview" },
{ id: "areas", label: "Your impact portfolio" },
{ id: "history", label: "Transactions" },
]}
active={active}
onChange={setActive}
/>A controlled page-level navigation bar. Each tab is a { id, label } pair; the
active tab is driven by the active prop and reported through onChange.
- Tablist — shown at
smand up: an underlined row with a strong-divider base border. The inactive tabs usetext-muted-foreground; the active tab usestext-foregroundwith a matching underline. - Select — below
smthe tablist collapses into a native<select>with a caret affordance, so the same navigation works on narrow viewports.
Dark mode: the muted/foreground text pair and the active underline map to semantic tokens, so the bar inverts correctly. The active indicator uses
border-foregroundrather than a fixed brand color, keeping the highlight legible against either background.