
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
darkmode-react-component
Advanced tools
**Effortlessly toggle between light and dark modes in your React projects!** A simple yet powerful component for bringing dark mode to your users. Give your application the look it deserves, day or night! ππ
Effortlessly toggle between light and dark modes in your React projects! A simple yet powerful component for bringing dark mode to your users. Give your application the look it deserves, day or night! ππ
π π Live Preview
Get started in seconds with npm! π―
npm install --save darkmode-react-component
Add DarkModeReact to your project with just a few lines:
import DarkModeReact from 'darkmode-react-component';
<DarkModeReact />
And thatβs it! Your users can now switch between themes seamlessly! β‘
Fine-tune the behavior of your dark mode switch with these props:
hiddenLabel
Hide the default label for a cleaner look:
<DarkModeReact hiddenLabel />
hiddenIcon
Prefer no icons? This oneβs for you:
<DarkModeReact hiddenIcon />
labelDark
& π labelLight
Customize the labels for a personal touch:
<DarkModeReact labelDark="Tema escuro" labelLight="Tema claro" />
Match the theme switch to your brandβs identity! Hereβs how you can modify the colors:
body {
--dm-color-primary: #41b883; /* Primary color */
--dm-color-secondary: #34495e; /* Secondary color */
--dm-color-text: #222; /* Text color in light mode */
--dm-color-background: #fff; /* Background color in light mode */
}
body.darkmode {
--dm-color-text: #fff; /* Text color in dark mode */
--dm-color-background: #222; /* Background color in dark mode */
}
π‘ Pro Tip: Use custom CSS variables to ensure consistency across your app, and let the .darkmode
class do the magic! β¨
When you use DarkModeReact, the following happens:
body
tag gets a .darkmode
class based on the current theme.LocalStorage
key saves the user's theme preference, so their choice sticks even when they refresh the page!.darkmode
in your stylesheets.Why choose DarkModeReact?
Found this component useful? Star β the repository, share it with fellow developers, and contribute your ideas! Let's build a stylish and accessible web, together! π
Got any suggestions or issues? Head over to the Issues section or open a Pull Request. Contributions are always welcome! π
DarkMode-React makes it easy to let users decide their preferred experience. With smooth transitions, customizable styles, and a straightforward setup, itβs the perfect addition to any modern React app.
FAQs
**Effortlessly toggle between light and dark modes in your React projects!** A simple yet powerful component for bringing dark mode to your users. Give your application the look it deserves, day or night! ππ
The npm package darkmode-react-component receives a total of 0 weekly downloads. As such, darkmode-react-component popularity was classified as not popular.
We found that darkmode-react-component demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last weekβs supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.