@react-theming/theme-swatch
v1.0.0
Published
[![npm version](https://badge.fury.io/js/%40react-theming%2Ftheme-swatch.svg)](https://badge.fury.io/js/%40react-theming%2Ftheme-swatch)
Downloads
98,624
Readme
@react-theming/theme-swatch
Install
npm i @react-theming/theme-swatch
Usage
import { createSwatch } from '@react-theming/theme-swatch';
/* you need to provide a `styled` functions from Styled Components, Emotion or '@storybook/theming' */
import styled from '@emotion/styled';
const ThemeSwatch = createSwatch(styled);
colors = ['red', 'green', '#13f0b7', 'rgb(100,180,250)'];
const YourComponent = () => {
return <ThemeSwatch theme={colors} size={64} />;
};