0.1.28 • Published 3 years ago
@refract-ui/docs v0.1.28
@refract-ui/docs
Storybook documentation and add-on for @refract-ui
Getting Started
This assumes you have Storybook installed.
- Install docs:
yarn add -D @refract-ui/docs
Update
.storybook/main.js
with the following:module.exports = { "stories": [ ..., "@refract-ui/docs/dist/**/*.stories.js" ], "addons": [ ..., "@refract-ui/docs/preset" ] }
Run storybook to see docs for
refract
Add On
@refract-ui
contains a preset add-on that does a few things:
- It provides a decorator that includes a Theme Provider so that the packaged stories have access to necessary theme props
- It orders the packaged stories
- It provides a toolbar tool for storybook that allows users to easily toggle between the default refract theme and a provided theme.
To add your own theme to the tool, create a new theme object and pass it to the refract.themes
array in preview.js
's parameters
.
// ./storybook/preview.js
import { theme } from '@refract-ui/core';
const tomatoTheme = {
name: 'Tomato Theme',
theme: theme({
themeColors: ({ defaults }) => ({
...defaults,
primary: 'tomato'
})
})
}
export const parameters = {
refract: {
themes: [
tomatoTheme
]
}
}
0.1.10
3 years ago
0.1.11
3 years ago
0.1.12
3 years ago
0.1.13
3 years ago
0.1.14
3 years ago
0.1.15
3 years ago
0.1.27
3 years ago
0.1.28
3 years ago
0.1.20
3 years ago
0.1.21
3 years ago
0.1.22
3 years ago
0.1.23
3 years ago
0.1.24
3 years ago
0.1.25
3 years ago
0.1.26
3 years ago
0.1.16
3 years ago
0.1.17
3 years ago
0.1.18
3 years ago
0.1.19
3 years ago
0.0.10
4 years ago
0.0.11
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.5
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago