All Projects → tomoya → storybook-addon-matrix

tomoya / storybook-addon-matrix

Licence: MIT License
Storybook addon for rendering components with a matrix of props

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to storybook-addon-matrix

storybook-addon-intl
Addon to provide a locale switcher and react-intl for storybook
Stars: ✭ 84 (+162.5%)
Mutual labels:  storybook, storybook-addon
storybook-addon-xd-designs
For adobe XD. Demo at https://morgs32.github.io/storybook-addon-xd-designs
Stars: ✭ 41 (+28.13%)
Mutual labels:  storybook, storybook-addon
storybook-xstate-addon
A storybook addon to assist with writing stories that rely on xstate
Stars: ✭ 48 (+50%)
Mutual labels:  storybook, storybook-addon
storybook-addon-mock
This addon allows you to mock fetch or XMLHttpRequest in the storybook.
Stars: ✭ 67 (+109.38%)
Mutual labels:  storybook, storybook-addon
storybook-addon-headless
A Storybook addon to preview content from a headless CMS in components
Stars: ✭ 23 (-28.12%)
Mutual labels:  storybook, storybook-addon
storybook-graphql-kit
Write GraphQL queries and pass response data to your components
Stars: ✭ 19 (-40.62%)
Mutual labels:  storybook, storybook-addon
pebble
Pebble Design System
Stars: ✭ 14 (-56.25%)
Mutual labels:  storybook
react-awesome-notifications
A beautiful fully customizable React + Redux notification system built with styled-components
Stars: ✭ 29 (-9.37%)
Mutual labels:  storybook
react-avancado-boilerplate
Boilerplate para projetos React com TypeScript e NextJS gerado no curso React Avançado com personalizações
Stars: ✭ 14 (-56.25%)
Mutual labels:  storybook
wheat-ui
Web Components 组件库;拍平框架差异
Stars: ✭ 17 (-46.87%)
Mutual labels:  storybook
chromatic-cli
Chromatic CLI: `npx chromatic`
Stars: ✭ 122 (+281.25%)
Mutual labels:  storybook
medly-components
🧩 Medly components provides numerous themable react components, each with multiple varitaions of sizes, colors, position etc.
Stars: ✭ 66 (+106.25%)
Mutual labels:  storybook
paygreen-ui
UI PayGreen Components: React, Styled Component
Stars: ✭ 29 (-9.37%)
Mutual labels:  storybook
react-tools-for-better-angular-apps
Use React ecosystem for unified and top notch DX for angular developement
Stars: ✭ 30 (-6.25%)
Mutual labels:  storybook
nextjs-starter-kit
NextJS Starter Kit with Testing Frameworks and CI/CD
Stars: ✭ 30 (-6.25%)
Mutual labels:  storybook
gypcrete
iCHEF web components library, built with React.
Stars: ✭ 28 (-12.5%)
Mutual labels:  storybook
React-Native-Web-TypeScript-Prettier-Boilerplate
A starterkit to work with nextjs, react-native, storybook… all with prettified typescript and in a monorepo
Stars: ✭ 16 (-50%)
Mutual labels:  storybook
common-components
Common components to be used across Quran.com, Quranicaudio.com and Salah.com
Stars: ✭ 35 (+9.38%)
Mutual labels:  storybook
react-magnetic-di
Dependency injection and replacement for React components and hooks
Stars: ✭ 103 (+221.88%)
Mutual labels:  storybook
widgetbook
Widgetbook is the custom widget library and collaboration platform for Flutter frontend teams.
Stars: ✭ 174 (+443.75%)
Mutual labels:  storybook

storybook-addon-matrix

Storybook addon for rendering components with a matrix of props.

stars Build Status Downloads Version size MIT License

npm i storybook-addon-matrix

View demo: https://storybook-addon-matrix.now.sh/

storybook-addon-matrix image

Usage

Globally

// .storybook/preview.js
import { addDecorator } from '@storybook/react';
import { withMatrix } from 'storybook-addon-matrix';

addDecorator(withMatrix);

// Your.stories.tsx
import * as React from 'react';
import { Box } from './Box';

export default {
  title: 'Box',
  component: Box,            // Must be present
  parameters: {
    matrix: {                // Parameter name is matrix
      pattern: {             // Let you write your matrix pattern
        bg: ['white', ...],  // Format is key: [value1, value2, ...]
        width: [undefined, ...],
      },
      // backgroundColor: 'rgba(0,0,0,0.7)', // Optional: If you want to change backgournd color
      // showOriginal: true // Optional: If you want to show original component set to true
    },
  },
};

export const Basic = () => <Box>TEXT</Box>;

Or individual

// Your.stories.tsx
import * as React from 'react';
import { withMatrix } from 'storybook-addon-matrix';
import { Box } from './Box';

export default {
  title: 'Box',
  component: Box,
  decorators: [withMatrix],
  parameters: {
    matrix: {
      pattern: {
        bg: ['white', 'blue', 'red', 'yellow'],
        width: [undefined, '50%', 256],
        p: [1, 2, 3],
      },
    },
  },
};

Do you want to more info? We have an example! Please let you try it.

$ git clone https://github.com/tomoya/storybook-addon-matrix.git
$ cd ./storybook-addon-matrix/example
$ yarn install
$ yarn start

Contributing

  1. Fork it (https://github.com/tomoya/storybook-addon-matrix/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

ToDO

  • Hide original componen
  • Global options to use addParameters()
    • Default backgournd color
    • Show original component
    • Number of columns
  • Theme compatibility
  • Show source
  • Release automation
  • Changelog

License

MIT License

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].