AppBadge is a small, display-only badge that shows one centered icon on a lifted surface. Reach for it when a tile, card, or row needs a compact visual mark — an app attribution, a pinned indicator — that is not itself a control.shapeProvider to choose its silhouette. The component owns its fixed square size, material, drop shadow, glow stroke, and primary icon tint, which keeps badges consistent across their surroundings.import { AppBadge } from '@wearables-ui-toolkit/mrbd';
import type { IconSource } from '@wearables-ui-toolkit/mrbd';
export function PinnedTileBadge({ pinIcon }: { pinIcon: IconSource }) {
return <AppBadge icon={pinIcon} />;
}
.tile {
position: relative;
}
.tile-badge {
position: absolute;
top: var(--uit-spacing-small);
right: var(--uit-spacing-small);
}
import {
AppBadge,
CornerRadius,
RoundedRectangleShapeProvider,
type IconSource,
} from '@wearables-ui-toolkit/mrbd';
const ROUNDED_SQUARE = new RoundedRectangleShapeProvider(CornerRadius.XXSMALL);
export function AppTileBadge({ appIcon }: { appIcon: IconSource }) {
return <AppBadge icon={appIcon} shapeProvider={ROUNDED_SQUARE} />;
}
tinted: false on a full-color app icon so it keeps its own colors. Add a label when the badge carries meaning on its own:<AppBadge
icon={{ uri: app.iconUrl, tinted: false }}
role="img"
aria-label={app.name}
/>
AppBadgeProps. It extends HTMLAttributes<HTMLDivElement> with children omitted — the badge renders exactly one icon and nothing else. Remaining DOM attributes, including data-*, aria-*, role, and event handlers, are forwarded to the root element, and ref resolves to that root div.| Prop | Type | Default | Description |
|---|---|---|---|
icon | IconSource | — | Decorative icon centered in the badge. Accepts inline vector data ( { viewBox, paths }), an asset handle ({ uri, tinted? }), or a bare URL string. Omit it for an empty badge. |
shapeProvider | ShapeProvider | a fully rounded RoundedRectangleShapeProvider | Geometry used for clipping and for the material’s fill and stroke paths. |
className | string | '' | Additional class appended to the component’s own root class. |
style | CSSProperties | — | Inline styles on the root element. The component’s own size wins, so this cannot resize the badge. |
screen blend against whatever is behind it, plus a drop shadow that lifts it off the underlying content and a glow stroke that keeps its edge readable on the additive-light display. The material is always visible; there is no idle or hidden state.--uit-color-icon-primary — inline vector data and URL assets are filled with that color. Pass { uri, tinted: false } when the asset is a full-color image that must keep its own palette.AppBadge sets no role, no tabIndex, and no press or focus states. It never becomes a focus stop on its own.AppBadge is decorative by default. It exposes no accessible name, and its icon is rendered aria-hidden, so assistive technology skips it entirely.role="img" and a localized aria-label to it; both are passed straight through to the root element.AppBadge as a compact mark attached to a larger, labelled object.shapeProvider, and construct that provider outside render to keep the material stable.tinted: false on full-color app artwork so it retains its palette.AppBadge renders an icon, not text.AppBadge does not accept children; only icon is rendered.