Skip to content

Shaped icon

Pro

An icon in a circle or an M3 Expressive shape, in a colour role's container colours: emphasis for steps, features and empty states. Not an M3 component (@windmorph/react-pro).

import { ShapedIcon } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Props

ShapedIcon 9 props

  • childrentype ReactNodeRequired

    The icon: an SVG, drawn at the size's icon size in the colour's content role.

  • shapetype ShapedIconShapedefault "circle"

    circle, or a shape outline drawn as a CSS mask: an M3 Expressive shape from @windmorph/react/primitives (shape={sunnyShape}) or an app's own MaterialShapePath. Its name goes to data-shape.

  • sizetype "sm" | "md" | "lg" | "xl"default "md"

    Container / icon: sm 40/24px, md 56/28px, lg 64/32px, xl 96/48px.

  • colortype "primary" | "secondary" | "tertiary" | "neutral" | "error" | "success" | "warning"default "secondary"

    The container's colour roles: its container colour, and the content colour on it. The accents, neutral, and the status roles error, success and warning.

  • reftype Ref<HTMLSpanElement>

    The container. Its other props (id, style, aria-*, data-*) go to it too.

Text

  • aria-labeltype string

    A name, when the icon means something on its own (role="img"). Otherwise it's decorative.

Also accepts the root element's HTML attributes (id, data-*, event handlers).

Spec status

Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.

  • Sizes: sm, md, lg, xl

    Built

    Configuration · Sizes

  • A circle or an M3 Expressive shape (a shape constant)

    Built

    Variant · Sizes, Steps

  • Colours: primary, secondary, tertiary, neutral, success, warning, error

    Built

    Variant · Colors

  • Leading icons for steps or features

    Built

    Use case · Steps

Theming

color picks the container roles (primary, secondary, tertiary, neutral, success, warning, error); size sets the container and icon (40/24, 56/28, 64/32 and 96/48px); shape is circle or a shape outline (shape={sunnyShape}, any of the 35 constants from @windmorph/react/primitives, or your own MaterialShapePath), drawn as a CSS mask, so the colours follow the theme; each outline adds only its own path to the bundle. Sizes are in px, so the shape keeps its size at larger text sizes. It has no tokens of its own: the root carries data-tokens="wm-shaped-icon" and the parts take classNames. In forced colours only the icon stays, in the system text colour, since the shape is decoration.