Skip to content

Solid icons: <Icon variant="solid"> from an opt-in entry - #629

Merged
lorant-one merged 8 commits into
previewfrom
claude/solid-icons
Nov 28, 2026
Merged

lorant-one merged 8 commits into
previewfrom
claude/solid-icons

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Lorant asked for the filled icons in core (28 Nov), on the condition that apps not using them don't pay for them. Icon looks icons up by name at runtime, so nothing in the registry is tree-shaken; the solid set therefore ships as its own entry.

Core

  • @once-ui-system/core/icons/solid exports solidIconLibrary: every built-in icon, filled, generated by scripts/generate-icons.mjs from once-ui-system/icons into src/icons/solidData.ts (about 14 KB gzipped, only for apps that import it; the main entry doesn't reference it, and a test checks that).
  • IconProvider takes solidIcons; <Icon variant="solid"> draws the solid icon and falls back to the line icon when none is registered.
  • Cut-outs that the icons repo paints in a background colour (--icon-knock) become SVG masks in createIcon, with ids from useId. They show whatever is behind the icon, so they work on any surface.
  • Every component that renders an icon grows about 0.5 KB raw, from the mask logic in createIcon; bundle-size.json is updated.
  • Tests in icon-solid.test.tsx cover: the set is complete, line is the fallback, solid when registered, masks instead of paint with unique ids, and the solid set is not in the main entry. The exports-map test lists the new entry.
  • CHANGELOG (Added), AI spec regenerated.

Docs

This contains #628's commits until that merges; I'll merge preview in afterwards. It's a new API, so it goes in the next minor.


Generated by Claude Code

/basics/icons: search the set, pick an icon to see it at every size, try it
in each colour and with round or square caps (data-border), and copy its
name or JSX. The Icon component page now points there instead of carrying
the gallery.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
Six columns of nowrap tiles were wider than the article (968 px in 704).
Four columns, tiles that may shrink, and labels that wrap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
Every built-in icon gets its filled version from the icons repo, generated
into src/icons/solidData.ts and exported from @once-ui-system/core/icons/solid
so only apps that import it ship it (Icon looks icons up by name at runtime,
so nothing in the registry is tree-shaken). IconProvider takes it as
solidIcons; Icon's variant="solid" draws it, falling back to the line icon.

Cut-outs that the icons repo paints in a background colour become SVG masks
(createIcon, ids from useId), so they show whatever sits behind the icon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
# Conflicts:
#	apps/docs/src/content/basics/icons.mdx
#	apps/docs/src/product/IconExplorer.tsx
@lorant-one
lorant-one merged commit 3aea6e3 into preview Nov 28, 2026
9 checks passed
@lorant-one
lorant-one deleted the claude/solid-icons branch November 29, 2026 13:44
@lorant-one lorant-one added the approved label Nov 29, 2026 — with Claude
@lorant-one lorant-one mentioned this pull request Nov 29, 2026
12 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants