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.

Keyboard

None. It isn't interactive, so it takes no keys and is never focused.

Screen reader

Role
None by default: the icon is decorative and hidden (aria-hidden). With aria-label it is an img.
Accessible name
Its aria-label, when given.
States announced
None.

Focus

None. It isn't interactive, so it never takes focus.

Touch target

None. It isn't interactive, so it has no touch target.

Motion

None. It doesn't move: the shape is a static mask.

What you need to do

  • Leave it decorative when the text beside it says what it means, as in a step or an empty state.
  • When the icon means something on its own, give it an aria-label: it becomes an image with that name.
  • Each colour draws the icon in its container's paired content role (on-secondary-container on secondary-container, and so on), which M3 keeps at 3:1 contrast or more in every scheme and contrast level. Keep any colour override to such a pair.
  • In forced-colours mode the icon takes the system text colour (CanvasText); keep classNames overrides from removing it.