New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-theme-switch

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-theme-switch

Add an 'invert theme' switch to React-based interfaces. Ideal for efficiently offering light interfaces a low intensity dark alternative.

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Theme Switch

A small, self-contained, and accessible component for inverting the theme of React-based interfaces. Uses progressive enhancement to provide a button which flips the theme's colors only where filter: invert(100%) is supported. Local storage persists the mode across browsing sessions.

Install

npm i react-theme-switch

Import

import ThemeSwitch from 'react-theme-switch';

Include

<ThemeSwitch />

Props

Just one optional prop is provided: preserveRasters. By default, raster images (images without the SVG extension, as well as videos) get inverted. To preserve them (through reinversion) use the preserveRasters Boolean.

<ThemeSwitch preserveRasters />

Accessibility

The switch is provided as a screen reader and keyboard accessible <button> element and toggles the aria-expanded state.

Keywords

FAQs

Package last updated on 05 Feb 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc