Comments (12)
I built a super lightweight version of this addon - that solves my problem above. Just pass your themes in and toggle with a dropdown 👍
from storybook-addon-material-ui.
Same issue here. Would be awesome to be able to toggle them.
from storybook-addon-material-ui.
All good - if I have a moment I’ll see if I can get something similar working in this package. I just wanted to wrap my themes rather than build them in storybook for an internal component library - branding and colours are already set.
from storybook-addon-material-ui.
@mayteio Thanks!!! It doesn't have all the features that I want, like color selection but this is already a great compromise <3 <3 <3
from storybook-addon-material-ui.
@mayteio awesome man, nice addon :) This is exactly what I was going to do. I'm going to see if I can just utilize yours instead
from storybook-addon-material-ui.
I built a super lightweight version of this addon - that solves my problem above. Just pass your themes in and toggle with a dropdown 👍
Worked the first time I tried it. Well done.
from storybook-addon-material-ui.
Hey here!
First of all sorry for the inconvenience and thank you for your patience 😸
While developing of stable version of this addon is in progress and you're looking for just a simple functionality, you can switch to another one:
https://github.com/react-theming/storybook-addon
It's an universal one and don't have Material-UI specific features, but you can use it when switching themes and changing colors is enough for your case
yarn add --dev @react-theming/storybook-addon
to use it with Material UI you'll need to pass theme provider into decorator this way:
import { withThemes } from '@react-theming/storybook-addon';
import { ThemeProvider } from '@material-ui/core';
import { createMuiTheme } from '@material-ui/core/styles';
import theme from '../theme';
const providerFn = ({ theme, children }) => {
const serialTheme = JSON.parse(JSON.stringify(theme));
const muTheme = createMuiTheme(serialTheme);
return <ThemeProvider theme={muTheme}>{children}</ThemeProvider>;
};
export default {
title: 'MUI Examples',
component: Component,
decorators: [withThemes(null, [theme], { providerFn })],
};
or see details in the template project https://github.com/react-theming/theming-material-ui
from storybook-addon-material-ui.
Bump I have the same problem. Would really like some solution
from storybook-addon-material-ui.
Thanks @mayteio
Also any PRs with improvements to this project are always welcome!
from storybook-addon-material-ui.
Had the same problem, but is ok when passing ThemeOptions instead of Theme into muiTheme decorator.
The issue still exists, as I am using typescript and should add an exception for this (
from storybook-addon-material-ui.
@vvetsko can we update https://github.com/react-theming/storybook-addon-material-ui/blob/version-1/storybook-addon-material-ui.d.ts to add the exception?
from storybook-addon-material-ui.
I have same issue. Has the issue been resolved?
from storybook-addon-material-ui.
Related Issues (20)
- Breaks Storyshots HOT 1
- MuiThemeProvider not Working with Separate Storybook Project HOT 3
- Support for 4.x version HOT 10
- Cannot download theme HOT 2
- Is it possible to show properties other than primary, secondary and error? HOT 1
- Angular Compatibility? HOT 2
- Is there support for TSX with this?
- Not passing themes to muiTheme() causes rendering errors HOT 5
- Possible to add globally to all stories?
- Support Storybook v6.1 HOT 3
- Wrong behaviour with Storybook 6.X HOT 4
- Localization HOT 3
- Material-ui V5 (next) HOT 2
- Support for Material UI Core 5.x HOT 6
- Custom themes are not displaying when switch HOT 1
- Consider making MUI peer dependency deps prominent in docs HOT 2
- Decorator Adding Extra Div HOT 2
- Addon doesn't show well HOT 15
- Plugin triggers React warnings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook-addon-material-ui.