Icon
A lucide icon by its kebab-case name, or a brand logo as brand:<slug>.
Preview
Add to your site
npx docs-sitekit add iconIt writes these files, and keeps a file you changed:
src/presentation/components/site/icon.tsxsrc/domain/brands/index.tssrc/domain/brands/brand.tssrc/domain/brands/brand-data.tssrc/domain/brands/icons.tssrc/domain/brands/custom-svg.ts
It requires nothing else from the registry.
Props
Built from the TypeScript types and the TSDoc comments of the component, so they cannot drift from the code.
| Key | Type | Default | Allowed values | Description |
|---|---|---|---|---|
name | string | required | - | A lucide icon in kebab-case, brand:<slug> for a logo that ships, or brand:custom/<name> for your own. |
label | string | - | - | Give the icon a name when it stands alone. The icon then has role="img" and that name, and a brand logo also carries it as a <title>, which a browser shows on hover. Without it the icon is decorative and hidden from assistive technology, because the text next to it already names the brand. |
brands | Record<string, BrandGlyph> | - | - | The custom logos of the site, by icon value. The page passes them in: the component reads no files. |
Variants and states
A brand logo
brand:<slug> draws one of the logos the kit ships, as an inline SVG in the color of the text.
With a name
An icon that stands alone gets a label, and then it has a role and a name.
A name that does not exist
A name that resolves to nothing draws a plain circle.
About
An icon from lucide-react by its name in kebab-case, such as shield-check, or a brand logo as brand:<slug>, such as brand:github. A logo is an inline SVG filled with currentColor, so it takes the color of the text and asks nothing from any host. The logos the kit ships, and how to add your own, are in Brand logos.
Accessibility
- An icon is decorative by default: it has
aria-hidden="true", because the text next to it already names what it shows. - With
label, the icon hasrole="img"and that name. A brand logo also carries it as a<title>, which a browser shows on hover. - A brand logo has
focusable="false", so an old browser does not put the SVG in the tab order. - A name that resolves to nothing draws a plain circle, hidden from assistive technology like any other decorative icon.
Source
Last updated