Skip to content
A ClojureScript implementation of Hiccup
Latest commit ac992fa Dec 16, 2013 @ibdknox bulleting and use of Element protocol
Signed-off-by: Chris Granger <>


Crate is a ClojureScript implementation of the awesome Hiccup html templating library.


(ns myapp
 (:use-macros [crate.def-macros :only [defpartial]])
 (:require [crate.core :as crate]))

(crate/html [:p.woot {:id "blah"} "Hey!"])
=> <p class="woot" id="blah">Hey!</p>

(defpartial header []
   [:h1 "My app!"]])

=> <header><h1>My app!</h1></header>

Differences from Hiccup

  • The crate.core/html returns dom nodes instead of strings of html
  • You can use dom nodes in element bodies like this:
(crate/html [:div (crate/raw "<span>foo</span><strong>bar</strong>")])
=> <div><span>foo</span><strong>bar</strong></div>


Copyright (C) 2011 Chris Granger

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.