@trautmann/theme-switch
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

Theme Switch

npm bundle size (scoped version) npm NPM

Introduction

Inspired from Kefah Rajha's (@kefah-rajha) "Night Day Button" and done for MUI. demo gif

Documentation and Demo

Storybook: https://theme-switch.trautmann.software

Support

You can buy me a coffee or support the project via

Usage

Please have a look into the storybook for more detailed usage examples and documentation.

import React from 'react';
import { PaletteSwitch } from '@trautmann/theme-switch';

export function Usage() {
  const [mode, setMode] = React.useState<'dark' | 'light'>('light');

  return (
    <PaletteSwitch size="medium" onChange={setMode} value={mode} />
  );
}

Current state

Currently, the switch is implemented for MUI 5, this means, it supports the same sizes as MUI Switch and renders in the same sizes as MUI Switch component. Support for other libraries and custom styling is also planned. If you need a support for a different library of custom styling, just open a ticket in out repo. It will be processed as soon as possible.

Package Sidebar

Install

npm i @trautmann/theme-switch

Weekly Downloads

0

Version

1.1.2

License

MIT

Unpacked Size

70.4 kB

Total Files

33

Last publish

Collaborators

  • rashad2985