WebAppIcon presents transparent monochrome artwork on a complete app-icon material. Use it when a Meta Wearables app manifest provides icon artwork and either a theme color or an explicit radial palette.import {WebAppIcon} from '@wearables-ui-toolkit/mrbd';
const iconSrc = new URL(
manifest.appearance.icon.src,
manifestUrl,
).href;
<WebAppIcon
iconSrc={iconSrc}
themeColor={manifest.appearance.theme_color}
aria-label={manifest.name}
/>;
themeColor continues to control the artwork tint when a radial palette is also present:const iconSrc = new URL(
manifest.appearance.icon.src,
manifestUrl,
).href;
<WebAppIcon
iconSrc={iconSrc}
themeColor={manifest.appearance.theme_color}
radialColors={manifest.appearance.icon_background?.colors}
radialStops={manifest.appearance.icon_background?.stops}
innerGlowColor={manifest.appearance.icon_background?.inner_glow_color}
aria-label={manifest.name}
/>;
iconSrc. Cross-origin artwork must allow the Web App origin through Cross-Origin Resource Sharing (CORS).WebAppIconProps. It extends HTMLAttributes<HTMLDivElement> with children, onLoad, and onError omitted. Remaining DOM attributes are forwarded to the root div, and ref resolves to that element.| Prop | Type | Default | Description |
|---|---|---|---|
iconSrc | string \| null | — | URL for transparent monochrome artwork. |
themeColor | string \| null | — | CSS hexadecimal color used to tint the artwork and derive the container palette. |
radialColors | readonly string[] \| null | — | Explicit radial-gradient colors. Each entry must be a CSS hexadecimal color. |
radialStops | readonly number[] \| null | evenly distributed | Offsets for radialColors. The array is ignored unless its length matches and its values are ordered from 0 through 1. |
innerGlowColor | string \| null | artwork tint | Focused inner-glow color. It does not change the artwork tint or container gradient. |
partialFocusLighting | boolean | true | Whether the foreground light follows partial focus. |
width | number | 112 | Visible width in pixels. |
height | number | 112 | Visible height in pixels. |
onIconReady | (succeeded: boolean) => void | — | Called after the requested artwork resolves. true means custom artwork is displayed; false means the fallback remains displayed. |
className | string | '' | Additional class appended to the component root. |
style | ContainerRootStyle | — | Inline styles for the component root. |
createWebAppIconMaterial(options) when an interactive Container owns focus and activation. The factory returns the complete material, its medium-corner shape provider, and an isFallback value. Create a separate material for each mounted container because a material instance owns its host state.import {
Container,
createWebAppIconMaterial,
} from '@wearables-ui-toolkit/mrbd';
const iconSrc = new URL(
manifest.appearance.icon.src,
manifestUrl,
).href;
const rendering = createWebAppIconMaterial({
iconSrc,
themeColor: manifest.appearance.theme_color,
});
<Container
width={112}
height={112}
contentClip="none"
material={rendering.material}
shapeProvider={rendering.shapeProvider}
aria-label={manifest.name}
onClick={openWebApp}
/>;
WebAppIcon provides those lifecycle behaviors.onIconReady(false) reports that result.themeColor is also present, it controls the artwork tint. Without a theme color, the first radial color controls the tint. Invalid or mismatched radial stops are discarded while valid colors remain usable.createWebAppIconMaterial also derives its artwork and effect geometry from the host container’s current bounds.WebAppIcon does not own focus or activation. Use it inside a labelled interactive composition, or use createWebAppIconMaterial with Container when the icon itself is the interactive surface.aria-label when the icon communicates identity on its own; the component then uses role="img" unless another role is supplied.Container, so the container owns the accessible role, name, focus, and activation behavior.WebAppIcon.Container when using createWebAppIconMaterial.WebAppIcon in another material surface because the extra surface obscures its app-icon treatment. Use the material factory when a surrounding Container must own interaction.WebAppIcon. Use a semantic control or the documented Container composition instead.