Skip to content

finding(components): ToggleGroupItem.icon is declared in types but no renderer reads it — authored icons render nothing #4632

Description

@yinlianghui

Measured while fixing #4624 (PR #4630). Filed unassigned. Duplicate-searched (keyword + ToggleGroupItem + the renderer path): no open issue covers it.

The finding

packages/types/src/disclosure.ts:131 declares an icon slot on toggle-group items:

export interface ToggleGroupItem {
  value: string;
  label: string;
  icon?: string;
  disabled?: boolean;
}

The renderer never reads it. packages/components/src/renderers/disclosure/toggle-group.tsx:33-37 maps items to:

{schema.items?.map((item, idx) => (
  {/* value and aria-label and label only */}
))}

Grepping icon across both that renderer and packages/components/src/ui/toggle-group.tsx returns nothing. disabled is declared and unread there too.

Impact

Dormant rather than breaking: an author who declares icon gets a correctly rendered toggle group with the icon silently dropped. Nothing goes red and nothing is misreported.

Concretely, examples/schema-catalog/src/schemas/components-disclosure-toggle-group/with-labels.json authors icon on all three items. PR #4630 fixes that entry's root type and deliberately KEEPS the icon keys, because they are declared fields rather than the entry inventing something — but the catalog is the corpus AI authoring tools retrieve from, so it is currently teaching a key that does nothing.

Options

  1. Implement it — render the icon alongside the label in ToggleGroupItem.
  2. Retire the declaration if there is no business pull for icon-bearing toggle items.

Either resolves it; leaving a declared-but-unread field is the state worth not keeping. Related class: #4631.

Refs #4624, PR #4630.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions