# Header

A polymorphic start, center, and end header layout.

`Header` arranges stable start and end actions around a flexible center region. Its rounded default surface uses `--sidebar` (`#eceff1` in light mode and `#0f0f0f` in dark mode), falling back to `--background-default`. It remains customizable through `className`, making it suitable for application headers, contextual toolbars, breadcrumbs, and status rows.

```tsx
import { Button, Header, Text } from "@zentara-co/zenos-ui";

function HeaderExample() {
  return (
    <Header
      as="header"
      start={<Text weight="bold">Workspace</Text>}
      end={<Button size="sm">Invite member</Button>}
      className="w-full rounded-xl border border-border bg-background-neutral-card"
    >
      <Text color="subtle">Production environment</Text>
    </Header>
  );
}
```

## Import

```tsx
import { Header } from "@zentara-co/zenos-ui";
```

## Regions

Use `start` for branding or navigation, children for the flexible center, and `end` for actions. Empty regions are omitted from the DOM.

```tsx
import { Badge, Breadcrumb, Button, Header, Stack, Text } from "@zentara-co/zenos-ui";

function HeaderCompositionExample() {
  return (
    <Stack gap="3" className="w-full">
      <Header
        start={
          <Badge variant="default" color="information">
            Preview
          </Badge>
        }
        end={
          <Stack direction="row" gap="2">
            <Button size="sm" variant="ghost">
              Documentation
            </Button>
            <Button size="sm">Publish</Button>
          </Stack>
        }
        className="rounded-xl border border-border bg-background-neutral-card"
      >
        <Text weight="bold">API reference</Text>
      </Header>
      <Header
        as="nav"
        aria-label="Project breadcrumb"
        start={<Text weight="bold">Acme</Text>}
        end={
          <Badge variant="default" color="success">
            Live
          </Badge>
        }
        className="rounded-xl border border-border bg-background-neutral-card"
      >
        <Breadcrumb.Root>
          <Breadcrumb.List>
            <Breadcrumb.Item>
              <Breadcrumb.Link href="#projects">Projects</Breadcrumb.Link>
            </Breadcrumb.Item>
            <Breadcrumb.Separator />
            <Breadcrumb.Item>
              <Breadcrumb.Page>Gateway</Breadcrumb.Page>
            </Breadcrumb.Item>
          </Breadcrumb.List>
        </Breadcrumb.Root>
      </Header>
    </Stack>
  );
}
```

## Semantic element

Header renders a `div` by default. Use `as="header"` for a page or application banner, or `as="nav"` when the whole region is navigation. The selected element controls the available native props and ref type.

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| start | ReactNode | — | Content anchored at the logical start. |
| children | ReactNode | — | Flexible center content. |
| end | ReactNode | — | Content anchored at the logical end. |
| native props | React.HTMLAttributes<HTMLElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

Choose `as` by meaning rather than appearance. A `header` becomes a banner landmark only in the appropriate document context, while a `nav` needs an accessible label when more than one navigation landmark exists.

Source: https://zenos-ui.pages.dev/layout/header/