Using yarn
yarn add @buffetjs/core @buffetjs/hooks @buffetjs/styles
# Install the required dependencies
yarn add lodash prop-types react react-dom react-router-dom styled-componentsor npm
npm install @buffetjs/core @buffetjs/styles @buffetjs/hooks --save
# Install the required dependencies
npm install lodash prop-types react react-dom react-router-dom styled-components --saveImport buffet.js into your project as follows:
importReactfrom'react';import{Enumeration,}from'@buffetjs/core';constPage=()=>{const[state,setState]=React.useState('milk');return(<header><p>Title</p></header><section><Enumerationname="enumeration"onChange={({target: { value }})=>setState(value)}options={[{value: 'flour',label: 'Flour',},{value: 'milk',label: 'Milk',},{value: 'butter',label: 'Butter',},]}value={state}/></section><footer>
Made with love by Strapi
</footer>);}exportdefaultPage;See the documentation at buffetjs.io/storybook for more informations.