Inference Logoinference.sh

Icon

Visual glyphs for actions and status indicators.

Preview

code
1   

Usage

go
1node := models.WidgetNode{2    Type: models.WidgetNodeTypeIcon,3    Name: "search",4    Size: "md",5}

Props

NameTypeDescriptionDefault
type"icon"Node typerequired
namestringName of the icon to displayrequired
sizestringSize token: xs, sm, md, lg, xl, 2xl, 3xl"md"
colorstring | ThemeColorIcon color"prose"

Available Icons

CategoryIcons
Actionscheck, plus, search, reload, play, write
Statusinfo, check-circle, check-circle-filled, empty-circle, dot
Navigationchevron-left, chevron-right, external-link
Objectsdocument, book-open, calendar, mail, globe
UIdots-horizontal, dots-vertical, settings-slider
Miscsparkle, sparkle-double, lightbulb, bolt, star, star-filled

Size Reference

SizePixels
xs12px
sm16px
md20px
lg24px
xl28px
2xl32px

Examples

Basic Icon

go
1{Type: models.WidgetNodeTypeIcon, Name: "check", Color: "success"}

Icon with Text

go
1{2    Type: models.WidgetNodeTypeRow,3    Gap:  2,4    Children: []models.WidgetNode{5        {Type: models.WidgetNodeTypeIcon, Name: "star-filled", Color: "warning"},6        {Type: models.WidgetNodeTypeText, Value: "Featured"},7    },8}

Status Indicator

go
1{2    Type: models.WidgetNodeTypeRow,3    Gap:  2,4    Children: []models.WidgetNode{5        {Type: models.WidgetNodeTypeIcon, Name: "check-circle-filled", Color: "success", Size: "lg"},6        {Type: models.WidgetNodeTypeCol, Gap: 0, Children: []models.WidgetNode{7            {Type: models.WidgetNodeTypeText, Value: "Payment Complete", Variant: "title"},8            {Type: models.WidgetNodeTypeText, Value: "Your order has been processed", Variant: "muted"},9        }},10    },11}

Button with Icon

Note: For buttons, use the iconStart or iconEnd props instead:

go
1{2    Type:      models.WidgetNodeTypeButton,3    Label:     "Search",4    IconStart: "search",5}

TypeScript

typescript
1const node: WidgetNode = {2  type: "icon",3  name: "sparkle",4  size: "lg",5  color: "primary",6}

Best Practices

  1. Use semantic icons - Match icon meaning to content
  2. Pair with text - Icons alone can be ambiguous
  3. Consistent sizing - Use same size for related icons
  4. Use color meaningfully - Success=green, Warning=yellow, etc.

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.