Icon

Chili provides its own lightweight set of SVG icons. Use icon names or the exported enum L.IconTypes.Icons to pick one.

Props

NameTypeDescription
fillstring | nullFill color, e.g. red or #ff0000 or rgb(255,0,0), default is none
iconIcon

Icon type, use a plain string with the icon name or use an exported icon names enum L.IconTypes.Icons.

All icon types see below

shouldRender
boolean
Pass false if you don't want the component to appear
sizenumber | string | nullIcon size, default is 24
strokestring | nullStroke color, e.g. red or #ff0000 or rgb(255,0,0), defaults to currentColor
strokeOpacitynumber | string | nullStroke opacity
strokeWidthnumber | string | nullStroke width, default is 2
[SVG props]SVGProps<SVGSVGElement>You can pass all supported SVG props
_[className]
[x: string]: unknown
E.g.: _w-48 adds a css class w-48 to the component's outer wrapper.
<L.Div _flex _mb-4>
  <L.Icon icon='star' />

  <L.Icon
    icon={L.IconTypes.Icons.Star}
    fill='gold'
    size={24}
    stroke='#66cc22'
    strokeWidth={1}
    _ml-4
  />
</L.Div>

All icons

calendar
check
check-circle
check-square
chevron-down
chevron-left
chevron-right
chevron-up
chevrons-left
chevrons-right
circle
eye
eye-off
loader
minus-square
plus-square
square
star
menu
x