Skip to content

Icon

Icon is the base svg primitive for creating accssible icons.

Usage

Basic usage for Icon component.

If no children is provided Icon will render a fallback icon.

Focusable Icon

By passing focusable prop we can make the icon keyboard focusable.

createIcon utility

To create icons more easily we provide a createIcon utility which takes few props and returns a React component;

Basic usage:

API Reference

Icon

Prop

Type

Default

asstring | React.ElementTypesvg

createIcon

Prop

Type

Default

viewBoxstring0 0 24 24
pathReact.ReactElement | React.ReactElement[]-
dstring-
displayNamestring-
defaultPropsPropsWithAs<IconProps, "svg">-