Components / Foundations

Icon

The built-in geometric 16/20px line icon set, plus custom { path, viewBox } definitions and snippets. Custom path strings are injected with {@html}: sanitising anything untrusted is the consumer's responsibility.

@ruckc/truss-ui Foundations

Import

import { Icon } from '@ruckc/truss-ui';

Playground

No interactive demo
This component is documented through its API reference below.

API

PropTypeDefaultDescription
name IconName | IconDef | Snippet—A built-in glyph name, a custom `{ path, viewBox? }` definition (inner SVG markup; rendered with `{@html}`, so sanitising untrusted strings is up to the caller) or a snippet that renders your own icon element.
size 16 | 2016Control size: `sm` (24px), `md` (32px, default) or `lg` (40px).
title string—Heading text.
children snippet Snippet—Custom icon markup (e.g. your own `<svg>`); used when `name` is not given.
/docs/icon Truss UI · MIT