ContainerHeader is the title treatment for a region of content: a card, a panel, a container-owned section. It renders a title, an optional subtitle, and at most one leading visual — an icon or an Avatar with its badge and status options. It is display-only and reports itself as a heading.ContainerHeader inside the content region it titles, typically within a Container or Card. It does not paint a surface. Header serves a different role: Page configures and renders that fixed, page-level route header.import { Container, ContainerHeader, StatusIndicatorType } from '@wearables-ui-toolkit/mrbd';
type Thread = {
name: string;
statusLabel: string;
photoUrl?: string;
isActive: boolean;
};
export function ThreadCard({ thread }: { thread: Thread }) {
return (
<Container>
<ContainerHeader
title={thread.name}
subtitle={thread.statusLabel}
avatarSrc={thread.photoUrl}
avatarAlt={thread.name}
statusIndicator={thread.isActive ? StatusIndicatorType.ACTIVE : undefined}
/>
{/* section content */}
</Container>
);
}
<ContainerHeader
title={sectionTitle}
subtitle={sectionSubtitle}
icon={sectionIcon}
/>;
<ContainerHeader title="Recently deleted" subtitle="Kept for 30 days" />;
.section {
display: flex;
flex-direction: column;
gap: var(--uit-spacing-small);
}
ContainerHeaderProps. It extends HTMLAttributes<HTMLDivElement>, so standard DOM attributes — including data-* — are forwarded to the root element, and the component forwards its ref there too. There is no children slot: the header renders only the props below.| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | Title text. Rendered in the emphasized label appearance, on one line, ellipsized when it does not fit. |
subtitle | string | — | Subtitle text. Rendered in the secondary metadata appearance, on one line, ellipsized when it does not fit. |
icon | IconSource | — | Leading icon. Rendered only when no avatar is present. |
avatarSrc | string | — | Avatar image URL. Supplying it makes the leading visual an avatar. |
avatarPrimaryContent | ReactNode | — | Custom node for the avatar’s primary slot. Also makes the leading visual an avatar. |
avatarAlt | string | 'Avatar' | Alt text passed to the avatar. The default is an English fallback only. |
statusIndicator | StatusIndicatorType | — | Status dot on the avatar. Only renders, and only affects the accessible name, when an avatar is present. |
statusIndicatorIcon | IconSource | — | Glyph drawn over the status dot. Only renders when statusIndicator is set. |
primaryImageShape | AvatarShape | — | Clip shape of the avatar’s primary image. |
placeholderStyle | PlaceholderStyle | — | Placeholder treatment used by the avatar when it has no image or content. |
avatarBadgeSrc | string | — | Image URL for the avatar’s badge slot. |
avatarBadgeContent | ReactNode | — | Custom node for the avatar’s badge slot. |
className | string | '' | Additional class on the root element. |
style | CSSProperties | {} | Inline styles applied to the root element. |
aria-label | string | title, subtitle, and the avatar’s status label joined with commas | Replaces the composed accessible name of the heading. |
ContainerHeader defines no enums of its own. Its avatar props take the enums exported alongside Avatar, which you import from the package root:import {
AvatarShape,
ContainerHeader,
PlaceholderStyle,
StatusIndicatorType,
} from '@wearables-ui-toolkit/mrbd';
AvatarShape — CIRCLE, ROUNDED_RECTANGLE.PlaceholderStyle — AVATAR, IMAGE.StatusIndicatorType — ACTIVE, INACTIVE, NOTIFICATION, UNREAD, POSITIVE, NEGATIVE, WARNING, CAUTION.icon and statusIndicatorIcon take an IconSource, the same union IconImage accepts: an inline vector description, a { uri } reference, or a bare URL string.avatarSrc or avatarPrimaryContent — wins; the icon renders only when there is no avatar. With neither, the text block starts further in, so text-only headers still align with the rest of the region.statusIndicator and statusIndicatorIcon only reach the avatar, so they do nothing on an icon-only or text-only header; statusIndicatorIcon additionally needs statusIndicator, because the dot is the glyph’s backdrop. The avatar clips to a circle unless primaryImageShape says otherwise.svg and takes the primary icon color; a URL source renders as a mask tinted to the same color, unless the source sets tinted: false, which renders the asset in full color. The icon slot is component-owned, so preserve its size.role="heading" at level 2, with an accessible name built by joining title, subtitle, and — when an avatar is present — the label for statusIndicator, in that order, with commas.title, or pass aria-label.aria-label replaces that composed name entirely. Do that only when the visible text is not a usable label.avatarAlt therefore does not reach the accessibility tree here — put the name in title.title so the heading and visible text agree.Header through Page for the page-level route header.ListItem for a focusable row in VerticalList, and ordinary typography for a simple section label.statusIndicator with an avatar; there is no status dot without one.ContainerHeader inside the material region it titles rather than wrapping the header in another rounded surface.