Adjusts the color scheme for all child components.
You should have the chayns-components
package installed. If that is not the
case already, run
yarn add chayns-components
or
npm i chayns-components
After the chayns-components
package is installed, you can import the component
and use it with React:
import React from 'react'
import { ColorScheme } from 'chayns-components';
// ...
<ColorScheme {...} />
The ColorScheme
-component takes the following props:
Name | Type | Default | Required |
---|---|---|---|
color | string |
||
secondaryColor | string |
||
colorMode | string | number |
||
children | ReactNode |
✓ | |
style | { [key: string]: string | number } |
{} |
|
cssVariables | { [key: string]: string | number } |
{} |
color?: string
The color to use for child components in hex format.
secondaryColor?: string
A secondary color to use for child components in hex format.
colorMode?: string | number
A color mode to use for child components.
children: ReactNode;
Children of the component.
style?: { [key: string]: string | number }
Styles to be set on the wrapper <div>
-element.
cssVariables?: { [key: string]: string | number }
An object of CSS variables that should be set on the <div>
-wrapper. Should
look like this: { "--my-css-var": 100 }
.