The head of a section inside a page: its title in the theme's heading font, a short count in small capitals at the end of the row (meta), an optional text action such as a link to the whole list, and a hairline under it. The action stays on the title's row on phones.
Install
Add SectionHeader from Ouro UI to this app. Read https:// ui.ouroboros.bot/ docs/ section-header.md first and follow it.Or by hand. Once per app, with Tailwind CSS v4 and an @/* path alias (Ouro HX is built on Base UI, so --base base; skip -t in an existing app):
npx shadcn@latest init --base base --preset nova --yes --no-monoreponpx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.3.344Then the component. From v0.8.0 it installs only the helpers it imports and never touches your stylesheet (Installing):
npx shadcn@latest add ourostack/ouro-ui/section-header#v1.3.344Or, with the @ouro namespace set up:
npx shadcn@latest add @ouro/ouro-base @ouro/section-headerIts tests, stories and Playwright spec are optional. They need Vitest 4.1.11 or later, and from v0.8.0 never change a version your app has (Testing):
npx shadcn@latest add ourostack/ouro-ui/section-header#v1.3.344 ourostack/ouro-ui/section-header-tests#v1.3.344import { SectionHeader } from "@/components/ouro/section-header/section-header";Paths use shadcn's default @/ alias; the CLI rewrites them to yours.
Example
<SectionHeader
title="Your recipes"
meta="2 recipes · 2 cookbooks"
actions={<Link href="/recipes">See all</Link>}
/>Use instead when
- Use
PageHeaderinstead for the top of the page, with its eyebrow, description and buttons, andHeadinginstead for a title with nothing around it.
Props
Type: SectionHeaderProps.
actions- Type:
ReactNode - A text action at the end of the row, such as a
Linkto the whole list. It stays on the title's row at every width. className- Type:
string - Layout only: margins, width (
mt-8). Appearance classes warn in development. divider- Type:
boolean - Default:
true - The hairline under the row, between the header and the section's content.
level- Type:
2 | 3 - Default:
2 - The title's heading level:
2under the page's<h1>,3for a section inside one. meta- Type:
ReactNode - A short count or status at the end of the row, in small tracked capitals: "2 recipes · 2 cookbooks". It wraps under the title when the row is too narrow for both.
ref- Type:
Ref<HTMLDivElement> - Reaches the rendered element.
title(required)- Type:
ReactNode - The section's title, its
<h2>(or<h3>withlevel={3}), in the theme's heading font.
Native attributes
Also accepts the attributes in React's HTMLAttributes (id, aria-*, event handlers), passed to the rendered element, except those named on this page.
Don't use
These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.
action: Not a prop. The link isactions:<SectionHeader actions={<Link href="/recipes">See all</Link>} />.count: Not a prop. The count ismeta:<SectionHeader title="Recipes" meta="12 recipes" />.description: Not a prop. The text beside the title ismeta:<SectionHeader meta="2 shelves" />.heading: Not a prop. The title istitle:<SectionHeader title="Recipes" />.
className is for layout only
Pass margins, width and grid placement (mt-4, w-full, col-span-2).
Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (hover:, sm:) and any ! are removed, it starts with bg-, text-, border-, rounded-, shadow-, font-, ring-, from-, via-, to-, fill- or stroke-, or is border, rounded, shadow or ring, or has a dark: variant. Text wrapping, overflow and table layout classes (text-wrap, text-ellipsis, border-collapse) are layout and do not warn.
Alignment classes (text-center) warn too: set alignment on a parent element.

