astrada / reason-react-toolbox-example

Example for reason-react-toolbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples using reason-react-toolbox

This repository contains ReasonML porting of react-toolbox-example.

Getting started

  1. Install dependencies:

    npm install --global bs-platform
    yarn install
    
  2. Generate theme files:

    yarn toolbox
    
  3. Start the demo:

    yarn start
    

How to create a new ReasonML app that uses reason-react-toolbox

  1. Setup a new app using create-react-app and reason-scripts:

    npm install -g bs-platform
    yarn create react-app <app-name> -- --scripts-version reason-scripts
    cd <app-name>
    
  2. Add dependencies:

    yarn add react-toolbox
    yarn add --dev @astrada/reason-react-toolbox react-toolbox-themr
    
  3. Add toolbox to scripts in package.json (as explained here):

    "toolbox": "react-toolbox-themr"
    
  4. Change name in bsconfig.json, and add @astrada/reason-react-toolbox to bs-dependencies

  5. Add fonts to public/index.html:

    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
  6. Wrap your component with ReactToolbox.ThemeProvider (see app.re)

  7. Generate theme files:

    yarn toolbox
    
  8. Start the app:

    yarn start
    

About

Example for reason-react-toolbox

License:MIT License


Languages

Language:OCaml 49.8%Language:JavaScript 34.7%Language:HTML 15.5%