Skip to content

Introduce Lucide based Icon component and updates - #209

Open
zoharma wants to merge 11 commits into
mainfrom
zma/ds-theme-lucide-icons
Open

zoharma wants to merge 11 commits into
mainfrom
zma/ds-theme-lucide-icons

Conversation

@zoharma

@zoharma zoharma commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Library icons now use Lucide instead of Material icons and react-icons.

Changes

  • Added LucideIcon and iconSizes, exported with the library icons (HomeIcon, SettingsIcon and others). Icons remain tree-shakeable.
  • DiamondDSTheme now uses Lucide icons by default for Alert, Select, NativeSelect, Autocomplete and Chip.
  • Navbar, NavMenu, Breadcrumbs, User, ScrollableImages and ColourSchemeButton now use Lucide icons. The User menu also includes Profile and Logout icons.
  • Updated stories to use the library icons, including SidebarNav and MuiWrapped.
  • Added an Icons page to the dev app.
  • Added lucide-react as a peer dependency (^1.35.0).
  • Removed react-icons and @mui/icons-material as library dependencies. The dev app keeps @mui/icons-material for Material React Table.

⚠️ Breaking

  • Consumers must install lucide-react.
  • @mui/icons-material and react-icons are no longer required unless used by the consuming app. JsonForms users still need @mui/icons-material for @jsonforms/material-renderers.
  • ColourSchemeButton test ids are now SunIcon and MoonIcon.

Not in this PR

  • Lucide icons for Material React Table via mrtOptions().
  • Lucide icons for JsonForms date pickers.

@akademy
akademy self-requested a review June 9, 2026 12:06
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch from 01666b0 to ab960fa Compare June 9, 2026 12:39
@zoharma
zoharma marked this pull request as draft June 9, 2026 12:58
@zoharma
zoharma marked this pull request as ready for review June 9, 2026 14:20
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch from 492ae7a to 5c56b01 Compare June 9, 2026 14:28
@zoharma zoharma added priority/p2-medium Planned, should do v0.6.0 and removed priority/p2-medium Planned, should do labels Jun 11, 2026
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch 2 times, most recently from 88f577a to 0190d4c Compare June 15, 2026 09:59
@akademy

akademy commented Jun 15, 2026

Copy link
Copy Markdown
Member

I was expecting this to just replace the icons line by line. Can you explain what the additional complexity is trying to achieve? (in particular, all the files in DataDisplay/Icons)

@zoharma zoharma removed the v0.6.0 label Jun 15, 2026
@zoharma

zoharma commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

I was expecting this to just replace the icons line by line. Can you explain what the additional complexity is trying to achieve? (in particular, all the files in DataDisplay/Icons)

As far as I understand, it's better to run Lucide Icons through MuiSvg as then props can be passed through to it. Also, the sizes (expanded list) and weight (Lucide specific) are not directly refelcted, so this covers for that.

Key icons will be in the theme, but if an app wants to use other icons they can import it from Lucide, and then use LucideIcon as the component with the right size as needed. We need to document that potentially.

@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch from 0190d4c to dc92db2 Compare June 24, 2026 09:14
@zoharma
zoharma marked this pull request as draft June 24, 2026 09:22
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch 3 times, most recently from 7d18fa5 to 0d22e85 Compare June 24, 2026 11:12
@zoharma zoharma added this to the 0.8.0 milestone Sep 10, 2026
@zoharma zoharma modified the milestones: 0.10.0, 0.9.0 Oct 6, 2026
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch 2 times, most recently from fe9bba3 to ce60aa1 Compare October 6, 2026 16:48
@zoharma

zoharma commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

I've reworked this branch and force-pushed it as a single commit:

  • LucideIcon now follows MUI's fontSize unless you pass size, forwards refs and merges sx.
  • DiamondDSTheme sets the Lucide defaults for Alert, Select, NativeSelect, Autocomplete and Chip, so the components no longer swap icons one by one.
  • lucide-react is a peer dependency, and the build keeps /*#__PURE__*/ annotations so unused icons tree-shake.
  • Icons are exported from the package entry.
  • react-icons and @mui/icons-material are no longer library dependencies, and the stories use the library icons. Consumer apps may still use them directly (JsonForms needs @mui/icons-material), so they only need to stay installed if your app calls them.

@zoharma
zoharma requested a review from a team October 6, 2026 16:56
@zoharma
zoharma marked this pull request as ready for review October 6, 2026 16:57
@zoharma zoharma added the priority/p2-medium Planned, should do label Nov 9, 2026
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch from ce60aa1 to 38325b5 Compare November 9, 2026 10:59
@zoharma
zoharma requested a review from douglaswinter November 9, 2026 11:00

@douglaswinter douglaswinter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The icons looks good. A few comments enclosed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add a story (or more) for icons inside buttons, and take a look at the disabled state, where the icon is darker at the path joints.

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.

Added with other components too

@@ -0,0 +1,114 @@
import type { Meta, StoryObj } from "@storybook/react-webpack5";
import { Box, Stack, Typography } from "@mui/material";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@VictoriaBeilsten-Edmands should these be imported from MuiWrapped?

@zoharma zoharma Nov 19, 2026 •

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.

The MUI stories import from MuiWrapped, but the stories for our own components import from @mui/material. I've followed the second group here. Happy to change if we want one rule for all of them.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of these wrapped icons? I see that a select few are used in the theme, but what about the rest?

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.

Good question. MuiWrapped used to wrap the Material icons under their Material names (AddIcon, DeleteIcon and so on), and the stories used those names. When we swapped to Lucide, I pointed those same names at the Lucide icons so the stories kept working.

You're right that most of them weren't needed. I've now removed the rest, and the stories call the Lucide icon directly with LucideIcon. The named icons only stay where they're actually used.

Comment thread src/components/controls/NumberInput.tsx Resolved
}}
>
<ArrowBackIosNewIcon data-testid="scroll-left-button" />
<ChevronLeftIcon data-testid="scroll-left-button" size="md" />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the story this icon is hard to see when it overlays an image, but it's like that in main too.

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.

I didn't fix the way it looks here, should I?

Comment thread src/themes/DiamondDSTheme.test.ts Resolved
- Added `LucideIcon` and `iconSizes`, with icons built via `createIcon`
- Exported the icons from the package entry; they stay tree-shakeable
- `DiamondDSTheme` uses Lucide by default for `Alert`, `Select`, `NativeSelect`, `Autocomplete`, `Chip`
- Components and stories now use the Lucide icons, including the `SidebarNav` story
- `lucide-react` is a new peer dependency (`^1.35.0`)
- Removed `react-icons` and the `@mui/icons-material` peer and dev dependencies
- Updated README, installation docs and changelog
- Drop @mui/icons-material and react-icons
- Bump lucide-react to 1.35.0
- Replace removed @mui/icons-material imports
- Use datadisplay to match the folder on case-sensitive filesystems
- Recommend latest lucide-react in install docs
- Restructure icons page with contents and Usage section
- Add brand icons guidance, re-enable LucideIcon guidance
- Changelog: other components, mark ColourSchemeButton test ids breaking
- Add --ds-on-surface-disabled-opacity; --ds-on-surface-disabled now derives from it
- LucideIcon, Select, NativeSelect and Chip icons use an opaque colour plus opacity when disabled
- Chip delete icon fades with opacity, not MUI's translucent colour
- Disabled chips use disabled tokens, so their icons are not faded twice
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch from 6b6021a to 64d1664 Compare November 19, 2026 17:31
- Chip delete icon is a plain X; Chip icons are 18px (16px on small chips)
- NumberInput spinner chevrons use the xs icon size (16px, up from 12px)
- Add an InComponents story with buttons, chips, alerts, selects and inputs
- Rename the LucideIcon story title to Components/Data Display/LucideIcon
- Check each Lucide default in the theme test by component, not just defined
- Trim the exported icons from 45 to the 21 the library and docs use
- Remove the Material-named icon aliases from MuiWrapped
- Stories use LucideIcon with a Lucide icon for the rest
…rtLabel and Tabs

- Set Lucide icon defaults in DiamondDSTheme for each component's icon slots
- Slot icons are private to the theme, so the exported icon set does not grow
- Add render tests that MUI's own default icons no longer appear
- Show the components in the InComponents story
…and AccordionSummary

- MUI already fades these when disabled, so the icon rule faded them a second time
- Icons inside them now keep the parent's colour at full opacity
- Add rendered tests for the four components
- Menu story and docs example use the sm icon size (20px), as in User
- MenuItem icon box is 28px wide instead of 36px
- Add a rendered test and a changelog line
@zoharma
zoharma force-pushed the zma/ds-theme-lucide-icons branch from 64d1664 to 2a5e2a2 Compare November 19, 2026 17:37
@zoharma

zoharma commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@douglaswinter Thank you for going through this. I've made the following changes:

  • Disabled icons no longer get darker where lines cross. I added a new token to help with that (--ds-on-surface-disabled-opacity).
  • I cut the wrapped icons from 45 to the 21 we use.
  • More components now use Lucide icons by default (I hope this is all of them).
  • Added a new "In components" view with key components with icons.

I've tried to split the commits to different aspects.

@zoharma
zoharma requested review from douglaswinter and removed request for akademy November 19, 2026 17:39

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants