React-bulma-switch
React component for Bulma Switch extension using React-Bulma-Components
You can find the Storybook of all components here
To Install
npm install react-bulma-components react-bulma-switch
or
yarn add -E react-bulma-components react-bulma-switch
To Use
;// You can import from the global component (you will need to include the css file dist/react-bulma-switch.min.css); // You can also include the js that also bundle the ccs (do not work with server-side rendering); // [RECOMENDED] If you use this approach configure webpack to handle sass files; <div> <Switch value rounded>Switch Rounded</Switch> <Switch value thin>Switch Thin</Switch> <Switch value rtl>Switch Text on the left</Switch> <Switch value outlined>Switch Text on the left</Switch> </div>;
Documentation
You can find the documentation in https://couds.github.io/react-bulma-switch
Each component import his own sass file, in this way you can reduce your css total file only including the styles you use, to enable this please configure your Webpack to handle sass files. You can use the webpack.config.js on the root folder of this repository
Some api/naming may vary of convention with the Bulma Docs, please refear to each storybook to see how to use each component (you can find the source code of the story usin ght button "Show info" on the top-right corner)
Override Bulma variables
To Override the variables set by Bulma you will need to create a sass file like this one (_variable.sass)
// ADD HERE variables you want to override
After that you will need to add to your webpack configuration an alias pointing to the file
resolve {
// Other resolve props
alias: {
// Other aliases
'_variables.sass': path.resolve(__dirname, 'relative/path/to/your/file/from/webpack/config/file'),
},
}
This page is open source. Noticed a typo? Or something unclear? Improve this page on GitHub