Skip to content

Icon

Renders an icon from a collection.

Usage

Code
import { createSystem } from 'frog/ui'
 
const { Icon } = createSystem()
 
function Example() {
  return <Icon name="zap" />
}

Icon Properties

color

Sets the color of the icon. Defaults to 'currentColor' or the color of the icon (when mode is set to 'bg').

Code
<Icon
  color="
background
background100
background200
invert
text
text100
text200
text300
text400
gray100
gray200
gray300
gray400
gray500
gray600
gray
gray700
gray800
gray900
gray1000
blue100
blue200
blue300
blue400
blue500
blue600
blue
blue700
blue800
blue900
blue1000
red100
red200
red300
red400
red500
red600
red
red700
red800
red900
red1000
amber100
amber200
amber300
amber400
amber500
amber600
amber
amber700
amber800
amber900
amber1000
green100
green200
green300
green400
green500
green600
green
green700
green800
green900
green1000
teal100
teal200
teal300
teal400
teal500
teal600
teal
teal700
teal800
teal900
teal1000
purple100
purple200
purple300
purple400
purple500
purple600
purple
purple700
purple800
purple900
purple1000
pink100
pink200
pink300
pink400
pink500
pink600
pink
pink700
pink800
pink900
pink1000
green800"
name="zap" />

mode

Sets rendering mode of the icon. Defaults to 'auto'.

Code
<Icon
  name="zap"
  
mode?: "auto" | "bg" | "mask" | undefined

Sets rendering mode of the icon.

mode
="auto"
/>

collection

Icon collection to use for resolving icons. Defaults to lucide imported from 'frog/ui/icons'.

The following collections are available:

Collection is mapped to the icons property on the UI System Variables.

Code
<Icon
  name="bolt"
  
collection?: Record<string, string> | { "academic-cap": string; "academic-cap-16-solid": string; "academic-cap-20-solid": string; "academic-cap-solid": string; "adjustments-horizontal": string; ... 1179 more ...; "x-mark-solid": string; } | undefined

Icon collection to use for resolving icons.

collection
={heroicons}
/>

name

Icon name in the current icon collection.

Code
<Icon
  
name: "text" | "a-arrow-down" | "a-arrow-up" | "a-large-small" | "accessibility" | "activity" | "air-vent" | "airplay" | "alarm-clock" | "alarm-clock-check" | "alarm-clock-minus" | ... 1436 more ... | "zoom-out"

Icon name in the current icon collection.

name
="bell"
/>

size

Sets the size of the icon.

Code
<Icon
  name="bell"
  size="
100%
0
1
2
3
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
52
56
60
64
72
80
96
128
160
192
224
256
48"
/>