Header shows the identity of the current route: a short text, an optional short metadata value, and at most one leading accessory — an icon, an avatar, or a loading indicator. It is display only; nothing in it is focusable or clickable.Header through the header* props on Page. Page creates the header and owns its placement, stacking, and relationship to the content below; applications do not render it directly. The props on this page map to the corresponding Page props one for one. For a heading that labels content inside a larger container-owned region, use ContainerHeader instead.import { HeaderAvatarSize, Page } from '@wearables-ui-toolkit/mrbd';
export function ProfileRoute() {
return (
<Page
headerText="Profile"
headerMetadata="Online"
headerShowAvatar
headerAvatarSrc={profileImageUrl}
headerAvatarAlt="Alex Chen"
headerAvatarSize={HeaderAvatarSize.LARGE}
>
<ProfileContent />
</Page>
);
}
<Page headerText="Messages" headerIsLoading={isSyncing}>
<MessageList />
</Page>
import { Page, StatusIndicatorType } from '@wearables-ui-toolkit/mrbd';
<Page headerText="Alerts" headerIcon={bellIcon}>
<AlertList />
</Page>;
<Page
headerText="Alex Chen"
headerShowAvatar
headerAvatarSrc={profileImageUrl}
headerAvatarAlt="Alex Chen"
headerStatusIndicator={StatusIndicatorType.ACTIVE}
>
<ProfileContent />
</Page>;
Header, HeaderAvatarSize, and the HeaderProps / HeaderHandle types are all exported from the package root.HeaderProps.| Prop | Type | Default | Description |
|---|---|---|---|
text | string | — | Header text. |
maxLines | number | 1 | Maximum number of text lines. |
metadata | string | — | Short supporting value shown next to the text. |
icon | IconSource | — | Leading icon. Shown only when no avatar and no loading state are active. |
showAvatar | boolean | false | Forces the avatar into the leading slot. Any avatar image or content prop also turns the avatar on. |
avatarSrc | string | — | Image URL for the avatar’s primary slot. |
avatarPrimaryContent | ReactNode | — | Content for the avatar’s primary slot. The avatar owns the slot size. |
avatarSecondarySrc | string | — | Image URL for the avatar’s secondary slot in the duo layout. |
avatarSecondaryContent | ReactNode | — | Content for the avatar’s secondary slot. The avatar owns the slot size. |
avatarBadgeSrc | string | — | Image URL for the avatar’s image-badge slot. |
avatarBadgeContent | ReactNode | — | Content for the avatar’s image-badge slot. The avatar owns the badge size. |
avatarAlt | string | — | Alternative text for the avatar image. Header supplies no default, so an omitted value falls through to the avatar’s own English fallback label. Pass a localized string. |
avatarSize | HeaderAvatarSize | HeaderAvatarSize.SMALL | Avatar size. |
statusIndicator | StatusIndicatorType | — | Status indicator shown on the avatar. |
statusIndicatorIcon | IconSource | — | Glyph drawn over the status-indicator dot. Only shows when statusIndicator is also set. |
primaryImageShape | AvatarShape | — | Shape of the avatar’s primary image. |
placeholderStyle | PlaceholderStyle | — | Placeholder treatment used by the avatar when it has no image or content. |
isLoading | boolean | false | Whether an indeterminate loader takes the leading slot. Wins over both the icon and the avatar. |
className | string | '' | Class added to the header root alongside the component’s own class. |
style | CSSProperties | {} | Inline styles applied to the header root. |
aria-label | string | Text and metadata | Seeds the accessible name in place of the text and metadata. |
HeaderProps is a closed interface: it does not spread arbitrary DOM attributes onto the root, and it has no children. Everything the header shows comes from the props above.| Member | Description |
|---|---|
SMALL | Compact avatar for a dense header. The default. |
LARGE | Prominent avatar for an identity-led header. |
StatusIndicatorType, AvatarShape, and PlaceholderStyle come from Avatar. IconSource is the shared icon contract; see Icons.Header forwards a HeaderHandle. The ref is the handle, not the DOM node.| Method | Returns | Description |
|---|---|---|
getHeaderHeight() | number | Measured header height in pixels, 0 before layout. |
getElement() | HTMLDivElement or null | The header root element, or null before mount. |
0 when the header is hidden.showAvatar, avatarSrc, icon, isLoading, or avatarSize and the component animates between accessory states itself — the outgoing accessory scales and fades out, the incoming one scales and fades in, and the header animates the width change that follows. There is nothing imperative to call. When the user prefers reduced motion the width change is skipped and the header snaps to its new size.isLoading is set, otherwise the avatar when showAvatar or any avatar image or content prop is set, otherwise icon. Passing an icon alongside avatar content silently shows the avatar.maxLines caps the text: at the default of one line the text never wraps and is clipped by the header bounds, and higher values clamp to that many lines. The cap is a safety net, not extra room for a long title.HeaderAvatarSize.LARGE.role="heading" at level 1, so assistive technology can jump to the route identity. The level is fixed and cannot be changed through props.aria-label replaces that composed pair.showAvatar is explicitly set and statusIndicator is present, the indicator’s description is appended to the accessible name — including when you supplied your own aria-label. Write labels that read correctly with that suffix. An avatar that is only inferred from avatarSrc or the other avatar content props still renders, but its status is not appended, so set showAvatar when the status has to be announced.aria-label, and no announced status.avatarAlt whenever an avatar is shown. Header adds no default of its own, so an omitted value falls through to the avatar’s built-in English fallback label.text and metadata to at most two words.avatarAlt whenever an avatar is shown.isLoading for in-flight route data instead of swapping in a separate spinner.Header is reserved for the page-level route identity.metadata to one useful qualifier instead of joining multiple facts with separators.maxLines as overflow space.