Menu Button with React
A Menu Button component with open/closed state made with:
- React
- CSS Modules
- SCSS
- Webpack
Live demo here
NOTE: This component was made to demonstrate the process of translating from Web Components to React Components. Click here to view the web-component version of this button.
Usage
<MenuButton>
Menu
</MenuButton>
Building
- Clone the repo locally
- From the local folder, run
npm install
to install dependencies
...for development
- Run
npm run build-dev
to initialise awebpack-dev-server
, which will hot-reload if the contents of/src/
are changed.
...for production
- Run
npm run build-prod
to bundle the app withwebpack
- the generatedbundle.js
will be placed in/dist/
.
NOTE: the index.html will be copied from
/src/
to/dist/
whenbuild-prod
orbuild-dev
are initially run, but changes toindex.html
will not trigger a hot-reload from the dev-server.