Skip to content

feat(icon): add form control glyphs - #4648

Draft
cixzhang wants to merge 1 commit into
feat/component-icon-mappingfrom
feat/form-control-icon-registry
Draft

feat(icon): add form control glyphs#4648
cixzhang wants to merge 1 commit into
feat/component-icon-mappingfrom
feat/form-control-icon-registry

Conversation

@cixzhang

@cixzhang cixzhang commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Why

Checkbox and radio state marks are icon-like glyphs. Keeping them in component-local SVG/div markup makes them harder to theme consistently with the icon registry and with component icon slots.

What

Adds form-control state glyphs to the icon registry and routes form-control internals through component icon slots:

  • Adds checkboxChecked, checkboxIndeterminate, and radioChecked to IconName / default icons / icon docs.
  • Adds component icon slots for CheckboxInput, RadioList, and DropdownMenu checkbox/radio state marks.
  • Updates CheckboxInput, RadioListItem, DropdownMenuCheckboxItem, and DropdownMenuRadioItem to resolve their decorative state glyphs through useIcon(slot, fallback).
  • Documents the available component icon slots in component theming docs.
  • Adds a Storybook demo showing a checkbox theme overriding checked and indeterminate glyphs.

Risk

Default visual intent is preserved: checked checkbox still renders a checkmark, indeterminate still renders a bar, and selected radio still renders a dot. The implementation now goes through the icon registry, so themes can remap those component purposes.

Testing

  • pnpm exec vitest run --project ui packages/core/src/Icon/globalIconRegistry.test.tsx packages/core/src/CheckboxInput/CheckboxInput.test.tsx packages/core/src/RadioList/RadioList.test.tsx packages/core/src/DropdownMenu/DropdownMenu.test.tsx --reporter=dot
  • pnpm -F @astryxdesign/core typecheck
  • pnpm -F @astryxdesign/core lint
  • pnpm check:sync
  • pnpm check:package-boundaries
  • pnpm check:changesets
  • pnpm -F @astryxdesign/core build

@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Error Error Aug 3, 2026 2:50am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 2, 2026
@cixzhang
cixzhang force-pushed the feat/form-control-icon-registry branch from fb5f3e0 to 6a4d36e Compare August 2, 2026 15:14
Comment thread packages/cli/assets/docs/icons.doc.mjs Outdated
['chevronLeft', 'Navigate back, previous'],
['chevronRight', 'Navigate forward, next'],
['check', 'Checkbox checked, confirm'],
['check', 'Confirm, selected option'],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkmark icon, specifically. Describe this in a way that can differentiate it from the others

Comment thread packages/cli/assets/docs/icons.doc.mjs Outdated
['check', 'Confirm, selected option'],
['checkboxChecked', 'Checked checkbox glyph'],
['checkboxIndeterminate', 'Indeterminate checkbox glyph'],
['radioChecked', 'Selected radio glyph'],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing unchecked states for radio and checkmarks

'@media (pointer: coarse)': 'auto',
},
},
markerUnchecked: {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be part of the icon not the component

),

/** checkbox checked glyph — checkmark for checked checkbox state */
checkboxChecked: (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark sure these render exactly the way they did before. We may want an internal set of checkbox and radio that take in states and just renders the components. It should be the full checkmark box, radio circle, etc so may not be a full svg. Also reuse the component for each state just change some state prop.

Maybe we should make them public like "radio icon" and "checkbox icon"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant