Icon

Built-in stroke icons, or any icon from an SVG node list.

Import

import { Icon } from "@tarve/core";

Usage

Icon.tsx
import { Icon, Row } from "@tarve/core";

<Row gap={12} align="center">
  <Icon name="settings" size={20} />
  <Icon name="heart" size={20} color="#f472b6" />
  <Icon iconNode={[["path", { d: "M5 12h14M12 5l7 7-7 7" }]]} size={20} strokeWidth={2} />
</Row>

Props

PropTypeDefault
color stringtheme.colors.foreground
iconNode readonly SvgNode[]—
name IconName—
size number16
strokeWidth number1.75

Common props

Shared by every component. See descriptions →

childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyle

Types

IconName
type IconName =
  | "check" | "x" | "plus" | "minus"
  | "chevron-down" | "chevron-up" | "chevron-right" | "chevron-left"
  | "search" | "info"
  | "house" | "settings" | "user" | "bell" | "heart" | "star"
  | "download" | "trash-2" | "folder" | "mail";
SvgNode
type SvgNode =
  | readonly [SvgElementName, SvgAttributes]
  | readonly [SvgElementName, SvgAttributes, readonly SvgNode[]];