Skip to content

feat(DropdownMenu): custom icon nodes + external-link items#315

Merged
I-am-nothing merged 1 commit into
mainfrom
feat/dropdown-icon-node
Jun 19, 2026
Merged

feat(DropdownMenu): custom icon nodes + external-link items#315
I-am-nothing merged 1 commit into
mainfrom
feat/dropdown-icon-node

Conversation

@I-am-nothing

Copy link
Copy Markdown
Contributor

What

DropdownMenu items could only take a Material Symbols icon name and had no way to indicate they open externally. This adds both, so a nav "more" menu can show a real brand logo and mark its external links:

  1. icon accepts a custom node. Material Symbols ships no brand logos (GitHub, etc.), so icon?: string | ReactNode — a string is still rendered via <Icon>; a node is rendered as-is (size it to ~the item icon size and use currentColor to inherit the muted colour).
  2. external?: boolean renders a trailing open-in-new glyph as the affordance for items that open in a new tab. Performing the navigation stays the caller's job in onSelect.

Backward-compat

  • String icons render byte-for-byte as before; items without external are unchanged. No behaviour change for existing callers; existing tests pass untouched.
  • Adds a CustomIconAndExternal story.

Versioning

  • Patch bump 0.5.11 → 0.5.12 (pre-1.0 patch-only), release label applied so the release workflow publishes on merge.

Adoption

  • The web-landing nav "more" menu adopts this next: GitHub item gets the real Octocat (custom icon node) and GitHub + Docs get the external glyph, on bumping to 0.5.12.

🤖 Generated with Claude Code

Items could only take a Material Symbols icon NAME, so a brand logo (e.g.
GitHub's mark, which Material Symbols doesn't ship) couldn't be used. Allow
`icon` to be a ReactNode as well, rendered in place of `<Icon>`.

Add `external?: boolean` on an item to render a trailing open-in-new glyph as
the affordance for items that open in a new tab (performing the navigation
stays the caller's job in onSelect).

Backward-compatible: string icons render exactly as before, and items without
`external` are unchanged. Adds a CustomIconAndExternal story.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@I-am-nothing I-am-nothing added the release Trigger a version bump on merge label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Storybook Preview: https://mirrorstack-ai.github.io/web-ui-kit/pr/315/

github-actions Bot added a commit that referenced this pull request Jun 19, 2026
@I-am-nothing I-am-nothing merged commit cc9c7d9 into main Jun 19, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in MirrorStack Platform Jun 19, 2026
github-actions Bot added a commit that referenced this pull request Jun 19, 2026
@I-am-nothing I-am-nothing deleted the feat/dropdown-icon-node branch June 19, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Trigger a version bump on merge

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant