Liking cljdoc? Tell your friends :D

semagent

Deprecated, Use gadfly361/soda-ash for best experience

Clojars Project

Semagent use reagent making semantic-ui easy to use, easy to change css classes.

CHANGES

  • 2017-08-08 use macros to generate components
  • 2017-05-29 update: bug fixes, code changes
  • 2016-11-03 update: add modules
  • 2016-11-13 update: add ui?

Overview

The original intention is when I writing component with reagent and semantic-ui, like this:

[:ui.primary.icon.button "..."]

It's to hard to modifiy classes :). So I make it into:

[Button
  {:s [:primary :icon]
   :tag :div}
   "..."]

Easy to change classes :blush:.

Usage

Add this to you dependencies in your project.clj:

[semagent "0.3.1"]

Then:

(:require [reagent.core :as r]
          [semagent.core :as s])

<0.3.0

Add this to you dependencies in your project.clj:

[semagent "0.2.0"]

Then:

(:require [reagent.core :as r]
          [semagent.elements.Button :refer [Button Buttons]]
          [semagent.elements.Container :refer [Container]]
          [semagent.collections.Breadcrumb :refer [Breadcrumb]]
          [semagent.views.Card :refer [Card]])

Or all:

(:require [reagent.core :as r]
          [semagent.sum :as s])

Examples

Put classes in the vector of {:s []}, with the keyword style:

when the version < 0.3.0, use {:sema []}

[Buttons {:s :vertical :class "test"}
  [Button {:s :red} "un"]
  [Button {:s :primary} "or"]
  [Button {:s :positive} "deux"]]

Change default tag with :tag + :keyword, like:

[Button
  {:s [:primary :icon]
   :tag :div}
   "..."]

Whether to insert ui class:

[Menu
  {:s :right
   :ui? false}
   "..."]

Dev

To get an interactive development environment run:

lein figwheel

and open your browser at localhost:3449.

To clean all compiled files:

lein clean

License

Copyright © 2017 g1eny0ung

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation? These fine people already did:
G1enY0ung & g1eny0ung
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close