All Projects β†’ react-theming β†’ Storybook Addon Material Ui

react-theming / Storybook Addon Material Ui

Licence: mit
Addon for storybook wich wrap material-ui components into MuiThemeProvider. πŸ“ƒ This helps and simplifies development of material-ui based components.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Storybook Addon Material Ui

Storybook Addon
Develop themable components with Emotion/Styled Components/Material-UI with help of Storybook & React Theming
Stars: ✭ 122 (-76.22%)
Mutual labels:  addon, material-ui, storybook
create-material-ui-app
create-react-app + storybook + storybook-addon-material-ui
Stars: ✭ 55 (-89.28%)
Mutual labels:  addon, material-ui, storybook
lerna-starter
Simple React UI Development environment boilerplate to develop, test and publish your React components.
Stars: ✭ 55 (-89.28%)
Mutual labels:  react-components, storybook
fyndiq-ui
Library of reusable web frontend components for Fyndiq
Stars: ✭ 39 (-92.4%)
Mutual labels:  react-components, storybook
gypcrete
iCHEF web components library, built with React.
Stars: ✭ 28 (-94.54%)
Mutual labels:  react-components, storybook
storybook-addon-mock
This addon allows you to mock fetch or XMLHttpRequest in the storybook.
Stars: ✭ 67 (-86.94%)
Mutual labels:  addon, storybook
react-crud-icons
57 SVG icons for CRUD applications, packaged as a React component with light & dark themes and tooltip.
Stars: ✭ 19 (-96.3%)
Mutual labels:  material-ui, react-components
availity-react
React components using Availity UIKit and Bootstrap 4
Stars: ✭ 46 (-91.03%)
Mutual labels:  react-components, storybook
react-you-do-you
How I use React + Redux + Material-UI + TypeScript – you do you πŸ’–
Stars: ✭ 103 (-79.92%)
Mutual labels:  material-ui, storybook
storybook-styled-components
No description or website provided.
Stars: ✭ 76 (-85.19%)
Mutual labels:  addon, storybook
smores-react
🍭 Marshmallow React components
Stars: ✭ 34 (-93.37%)
Mutual labels:  react-components, storybook
msw-storybook-addon
Mock API requests in Storybook with Mock Service Worker.
Stars: ✭ 168 (-67.25%)
Mutual labels:  addon, storybook
storybook-addon-next
A no config Storybook addon that makes Next.js features just work in Storybook
Stars: ✭ 184 (-64.13%)
Mutual labels:  addon, storybook
orfium-ictinus
This repo will include the building blocks to create the Orfium Parthenons to come ...
Stars: ✭ 20 (-96.1%)
Mutual labels:  react-components, storybook
best-of-react
πŸ† A ranked list of awesome React open-source libraries and tools. Updated weekly.
Stars: ✭ 364 (-29.04%)
Mutual labels:  material-ui, react-components
Stardust
🎨Tiller Design System
Stars: ✭ 19 (-96.3%)
Mutual labels:  react-components, storybook
React Crm
A reusable CRM project for real-world business based on React 16, Redux & Material-UI 4
Stars: ✭ 307 (-40.16%)
Mutual labels:  material-ui, storybook
storybook-xstate-addon
A storybook addon to assist with writing stories that rely on xstate
Stars: ✭ 48 (-90.64%)
Mutual labels:  addon, storybook
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (-83.43%)
Mutual labels:  react-components, storybook
storybook-addon-headless
A Storybook addon to preview content from a headless CMS in components
Stars: ✭ 23 (-95.52%)
Mutual labels:  addon, storybook

Codacy Badge npm version Live demo

Storybook Addon Material-UI

Storybook Addon Storybook Addon

Provides development environment which helps creating Material-UI Components. This is addon for React Storybook which wraps your components into MuiThemeProvider. This accelerates and simplifies the development process for Material-UI based applications.

You can use this project's demo page to discover Material-UI Theme Settings for any component and create your own new themes right online. But to take full advantage of this project run it locally in your work environment.

screen1

Features

Live demo

  • Wrapped in the theme provider. Just start to develop with base light theme.
  • Injected TapEvent Plugin. Test on mobile devices.
  • Switching themes. See how it looks in one click.
  • Creating your custom theme. By code or in visual editor.
  • Dynamic visual themes editing. Discover the all avalibale theme properties.
  • Google material color palette picker
  • Save made changes and download in JSON file
  • Part of React Theming. Create themable React Components.
  • Works with Storybook 3.0

Quick Start

In order to quick start with the latest storybook-addon-material-ui you can check out create-material-ui-app

It contains the working setup with:

  • create-react-app
  • Storybook
  • Material-UI
  • storybook-addon-material-ui

Getting Started

First, install the addon

npm i storybook-addon-material-ui --save-dev

Storybook 6.1

Add storybook-addon-material-ui to the storybook addons:

//.storybook/main.js

module.exports = {
  stories: ['../stories/**/*.stories.(js|mdx)'],
  addons: [
    'storybook-addon-material-ui'
  ],
};

Add the decorator to storybook preview:

//.storybook/preview.js

import { muiTheme } from 'storybook-addon-material-ui'

export const decorators = [
	muiTheme()
];

Note : You can switch between the loaded themes. Out of the box, you have two base themes, but you can simply add your custom themes like this:

//.storybook/preview.js

import { muiTheme } from 'storybook-addon-material-ui'

// Create your own theme like this.
// Note: you can specify theme name in `themeName` field. Otherwise it will be displayed by the number.
// you can specify only required fields overriding the `Light Base Theme`
const newTheme = {
    themeName: 'Grey Theme',
    palette: {
        primary1Color: '#00bcd4',
        alternateTextColor: '#4a4a4a',
        canvasColor: '#616161',
        textColor: '#bdbdbd',
        secondaryTextColor: 'rgba(255, 255, 255, 0.54)',
        disabledColor: '#757575',
        accent1Color: '#607d8b',
    },
};


export const decorators = [
	muiTheme([newTheme])
];

or even import from elsewhere

//.storybook/preview.js

import { muiTheme } from 'storybook-addon-material-ui'

import theme1 from './src/theme/theme1'
import theme2 from './src/theme/theme2'

export const decorators = [
	muiTheme([theme1, theme2])
];

Storybook 5 (and older versions)

Now, write your stories with Material-UI Addon. By default your stories will be provided with Light Base Theme and Dark Base Theme

import React from 'react';
import { storiesOf, addDecorator } from '@storybook/react';
import {muiTheme} from 'storybook-addon-material-ui';

// Import some examples from react-theming https://github.com/react-theming/react-theme-provider/blob/master/example/
import CardExampleControlled from '../CardExampleControlled.jsx';
import RaisedButtonExampleSimple from '../RaisedButtonExampleSimple.jsx';
import DatePickerExampleSimple from '../DatePickerExampleSimple.jsx';

storiesOf('Material-UI', module)
// Add the `muiTheme` decorator to provide material-ui support to your stories.
// If you do not specify any arguments it starts with two default themes
// You can also configure `muiTheme` as a global decorator.
    .addDecorator(muiTheme())
    .add('Card Example Controlled', () => (
            <CardExampleControlled />
        ))
    .add('Raised Button Example Simple', () => (
            <RaisedButtonExampleSimple />
        ))
    .add('Date Picker Example Simple', () => (
            <DatePickerExampleSimple />
        ));

Note : You can switch between the loaded themes. Out of the box, you have two base themes, but you can simply add your custom themes like this:

import React from 'react';
import { storiesOf, addDecorator } from '@storybook/react';

import {muiTheme} from 'storybook-addon-material-ui';

import CardExampleControlled from '../CardExampleControlled.jsx';
import RaisedButtonExampleSimple from '../RaisedButtonExampleSimple.jsx';
import DatePickerExampleSimple from '../DatePickerExampleSimple.jsx';

// Create your own theme like this.
// Note: you can specify theme name in `themeName` field. Otherwise it will be displayed by the number.
// you can specify only required fields overriding the `Light Base Theme`
const newTheme = {
    themeName: 'Grey Theme',
    palette: {
        primary1Color: '#00bcd4',
        alternateTextColor: '#4a4a4a',
        canvasColor: '#616161',
        textColor: '#bdbdbd',
        secondaryTextColor: 'rgba(255, 255, 255, 0.54)',
        disabledColor: '#757575',
        accent1Color: '#607d8b',
    },
};



storiesOf('Material-UI', module)
    .addDecorator(muiTheme([newTheme]))
    .add('Card Example Controlled', () => (
            <CardExampleControlled />
        ))
    .add('Raised Button Example Simple', () => (
            <RaisedButtonExampleSimple />
        ))
    .add('Date Picker Example Simple', () => (
            <DatePickerExampleSimple />
        ));


Feedback

You can left your opinion about this project via anonymous survey.

Query string parameters

As you select themes and other options it stores in adress bar line. So this state is retained when you refresh the page and you can use direct links to the desired states.

http://localhost:9001/?theme-ind=0&theme-sidebar=true&theme-full=true

CONTRIBUTING

@airbnb

Developers:

Our team welcome all contributing, testing, bug fixing. If you would like to help contribute to the project feel free to make an issue, PR or get in touch with me.

Designers:

We would really welcome the involvement of designers in this project. We are very interested in your opinion about working with this tool, the possibility of joint work of the designer and developer as well as its appearance and capabilities

Credits

Created with ❀︎ to Storybook and Material-UI by Oleg Proskurin [React Theming]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].