# Icons A library of SVG icon components used throughout Vesper. Each icon renders as an inline `` element with `currentColor` fill, making it easy to style via CSS. An `Icon` component is also available for rendering icons dynamically by name. ```tsx demo import { Icon, ICON_KINDS } from "@tenstorrent/vesper/icons"; import { Tooltip } from "@tenstorrent/vesper/tooltip"; export default function IconsDemo() { return (
{ICON_KINDS.map((kind) => ( ))}
); } ``` ## Options Each individual icon component (e.g., `Add`, `Gear`, `Search`) accepts all standard `SVG` element props (`ComponentProps<"svg">`). The dynamic `Icon` component also accepts: | Prop | Type | Description | Default | | ------ | ---------- | --------------------------------------------------------------------------------------- | ------- | | `kind` | `IconKind` | The name of the icon to render. See the full list of available icon kinds in Storybook. | — | ## Examples ### Rendering individual icons You can import individual icons from `@tenstorrent/vesper/icons` on an as-needed basis. These imports are [tree-shakeable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking), so your application can only bundle the icons that are actually used: ```tsx demo import { Add, Gear, Search } from "@tenstorrent/vesper/icons"; export default function IndividualIcons() { return (
); } ``` ### Rendering icons dynamically In addition to separate components for each individual icon, Vesper also exposes a dynamic `Icon` component which accepts a `kind` prop to determine which icon to render. ```tsx demo import { Icon } from "@tenstorrent/vesper/icons"; export default function DynamicIcons() { return (
); } ``` See the full list of available icon kinds in [Storybook](/storybook/?path=/story/components-icons--playground). > [!WARNING] > > Because the dynamic `Icon` component requires all icons to be available at runtime, it is **not** [tree-shakeable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) and will increase bundle size more than if you were to import the icons that you need individually. ### Coloring icons By default, an icon component is rendered using the inherited [current color](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value#currentcolor_keyword) of its parent. If you need to render an an icon in a different color other than the current color, you can use the `color` prop: ```tsx demo import { Globe, Icon } from "@tenstorrent/vesper/icons"; export default function ColoredIcons() { return (
); } ``` ### Pre-colored icons Some icons ship with both colored and uncolored versions. The colored icon component names are the same as their uncolored name suffixed with the word "Color". These are typically branded icons for different AI models, and should **not** have their colors overridden with CSS, inline styles, or the `color` prop: ```tsx demo import { ModelDeepSeekColor, ModelFalconColor, ModelGoogleColor, ModelLlamaColor, ModelQwenColor, } from "@tenstorrent/vesper/icons"; export default function PreColoredIcons() { return (
); } ``` ```tsx import { Icon } from "@tenstorrent/vesper/icons"; export default function PreColoredDynamicIcons() { return (
); } ```