npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@brightlayer-ui/react-themes

v9.0.1

Published

React themes for Brightlayer UI applications

Readme

Brightlayer UI themes for React applications

Build

This package provides theming support for Eaton applications using the Brightlayer UI design system. It includes resources for developers using React w/ Material UI version 6+ (prior versions of this package will work with Material UI version 5 - check the Changelog for details). This package now comes with a single theme option that supports both light mode and dark mode.

For other frameworks, check out our related packages:

Installation

Install with npm

npm install --save @brightlayer-ui/react-themes

or yarn

yarn add @brightlayer-ui/react-themes

Usage

To use these themes in your application, simply wrap the app in a ThemeProvider and pass in the theme:

import { ThemeProvider } from "@mui/material/styles";
import { theme } from "@brightlayer-ui/react-themes";

<ThemeProvider theme={theme}>
    <App />
</ThemeProvider>;

The theme will default to light/dark mode based on the user's system preference. To manually toggle the theme mode (e.g., from settings), you will need to use the useColorScheme hook (see below).

Changing the default mode

If you do not want to use the system setting as the default, you can set the defaultMode on the ThemeProvider:

<ThemeProvider theme={theme} defaultMode={"dark" /* or 'light' */}></ThemeProvider>

Manually toggling the mode

You can manually toggle the theme mode using the useColorScheme hook:

import { useColorScheme } from "@mui/material/styles";
import InvertColors from "@mui/icons-material/InvertColors";
import IconButton from "@mui/material/IconButton";
import Tooltip from "@mui/material/Tooltip";

const ToggleComponent = () => {
    const { mode, setMode } = useColorScheme();

    return (
        <Tooltip title={"Toggle Theme"}>
            <IconButton
                onClick={() => {
                    setMode(mode === "light" ? "dark" : "light");
                }}
            >
                <InvertColors />
            </IconButton>
        </Tooltip>
    );
};

For more information on toggling modes, refer to the MUI docs.

For more detailed information about the BLUI themes, refer to our developer documentation site.

Migration from v8 to v9

In version 9, the theme now follows the standard from MUI v7. In order to use the new version, you will need to:

Update Material UI

Ensure you have updated your Material UI dependencies to version 7 (this includes @mui/material, @mui/icons-material, etc.). Refer to the official MUI migration docs for more details.

Migration from v7 to v8

In version 8, the theme now follows the standard from MUI v6, which combines light and dark theme into a single theme object. In order to use the new version, you will need to:

Update Material UI

Ensure you have updated your Material UI dependencies to version 6 (this includes @mui/material, @mui/icons-material, etc.). Refer to the official MUI migration docs for more details.

Consolidate themes

If you were previously switching between blue and blueDark themes in your ThemeProvider, this should be replaced with the single theme object.

- import { blue, blueDark } from '@brightlayer-ui/react-themes';
+ import { theme } from '@brightlayer-ui/react-themes';

- <ThemeProvider theme={isDark ? blueDark : blue}></ThemeProvider>
+ <ThemeProvider theme={theme}></ThemeProvider>

Update logic to toggle the theme mode

Instead of swapping entire theme objects, you will now make use of the useColorScheme hook to toggle between light and dark mode. Refer to the usage instructions above or the MUI docs for more details.

Note: For few cases some styles may not apply correctly, hence they need to be declared explicitly for specific mode.

    sx={{
    backgroundColor: statusColor || Colors.black[500],
    color: getIconColor(),
    ...theme.applyStyles('dark', {
        color: getIconColor(),
        backgroundColor: statusColor || Colors.black[500],
    }),
}}