Skip to content

An interface between clojurescript's reagent and cljsjs/material-ui

License

Notifications You must be signed in to change notification settings

Guliy/baking-soda-material-ui

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

baking-soda-material-ui

Baking-soda-material-ui is an interface between clojurescript's reagent and material-ui (i.e., material-ui 1.0 react components).

Usage

Put the following in the :dependencies vector of your project.clj

[cljsjs/react "16.3.2-0"]
[cljsjs/react-dom "16.3.2-0" :exclusions [cljsjs/react]]
[reagent "0.8.0" :exclusions [cljsjs/react
                              cljsjs/react-dom]]
[alexeypopov/baking-soda-material-ui "0.0.1" :exclusions [cljsjs/react
                                                          cljsjs/react-dom
                                                          cljsjs/reagent]]

Then require baking-soda in your namespace.

(ns foo.bar
  (:require [baking-soda-material-ui.core :as bsmu]))

Example

Let's take a look at a modal. In javascript, you'd write something like this:

/* eslint react/no-multi-comp: 0, react/prop-types: 0 */

import React from 'react';
import ReactDOM from 'react-dom';
import Button from '@material-ui/core/Button';

function App() {
  return (
    <Button variant="raised" color="primary">
      Hello World
    </Button>
  );
}

However, in clojurescript with baking-soda, you'd write something like this:

(ns foo.bar
  (:require
   [reagent.core :as reagent]
   [baking-soda-material-ui.core :as bsmu :refer [Button]]))


(defn app []
 [:div
  [Button {:variant "raised"
           :color "primari"}
           "Hello World"]])

License

Copyright © 2018 Guliy Anatoliy, Alexey Popov

Based on baking-soda by Matthew Jaoudi

Distributed under the The MIT License (MIT).

About

An interface between clojurescript's reagent and cljsjs/material-ui

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 100.0%