ThemeIcon
Render icon inside element with theme colors
Import
Source
Docs
Package
Usage
Radius
xs
sm
md
lg
xl
Size
xs
sm
md
lg
xl
Color
Color
ThemeIcon supports all colors from theme.colors, default color is theme.primaryColor:
Gradient variant
To use gradient as ThemeIcon background:
- set
variant
togradient
- set
gradient
to{ from: 'color-from', to: 'color-to', deg: 135 }
, wherecolor-from
andcolor-to
are color fromtheme.colors
deg
is linear gradient deg
Size
ThemeIcon does not control icon size, specify it manually on icon component for better fit. ThemeIcon has 5 predefined sizes: xs, sm, md, lg, xl. Size controls width and height. Alternatively, a number can be used to set width and height in px:
Sizes from xs to xl:
Radius
xs, sm, md, lg, xl radius values are defined in theme.radius. Alternatively, a number can be used to set radius in px:
Default radius from xs to xl for xl size:
Feedback
Your feedback is most valuable contribution to the project, please share how you use Mantine, what features are missing and what is done good
Leave feedback