0.1.28 • Published 2 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
2 years ago
0.1.11
2 years ago
0.1.12
2 years ago
0.1.13
2 years ago
0.1.14
2 years ago
0.1.15
2 years ago
0.1.27
2 years ago
0.1.28
2 years ago
0.1.20
2 years ago
0.1.21
2 years ago
0.1.22
2 years ago
0.1.23
2 years ago
0.1.24
2 years ago
0.1.25
2 years ago
0.1.26
2 years ago
0.1.16
2 years ago
0.1.17
2 years ago
0.1.18
2 years ago
0.1.19
2 years ago
0.0.10
3 years ago
0.0.11
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.5
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago