A ClojureScript library of Bootstrap 3 components built on top of Om. See the documentation site for a ton of usage examples.
Here's the latest Leiningen version info:
This is an alpha release. The API and organizational structure are subject to change. Comments and contributions are much appreciated.
This project's goal is to provide wrappers for all Bootstrap 3 components, active or inactive, so they can be used easily in Om / ClojureScript projects.
Om-Bootstrap's documentation site has usage examples for all components that exist so far. The following components are currently complete:
- Button, ButtonGroup, Toolbar (button.cljs)
- Input (input.cljs)
- Jumbotron (random.cljs)
- Label (random.cljs)
- Well (random.cljs)
- PageHeader (random.cljs)
- Grid, Row, Col (grid.cljs)
- Glyphicon (random.cljs)
- ToolTip (random.cljs)
- Alert (random.cljs)
- Nav, NavItem (nav.cljs)
- Popover (random.cljs)
- Badge (random.cljs)
- Table (table.cljs)
The project contains a few mixins that help in writing active Om components. THe current set of mixins makes it easy to set listeners and timeouts on some component, and guarantee that they'll be cleaned up when the component unmounts:
- Listener (mixins.cljs)
- Timeout (mixins.cljs)
- Modal, ModalTrigger (modal.cljs)
- ProgressBar (progress_bar.cljs)
- Nav Collapsible Functionality
These, and the mixins below, are the project's biggest TODOs.
- DropdownButton, SplitButton, MenuItem
- DropdownMenu (?)
- Subnav (?)
- Panel (hard), PanelGroup (easy), Accordion (easy)
- NavBar
- TabbedArea, TabPane
- Pager
- Carousel
- CarouselItem
- FadeMixin
- Overlay
- DropdownStateMixin
- CollapsibleMixin
om-bootstrap
comes with a development environment you can use to hack on the demo project. First, start the repl with:
lein repl
You'll be dropped into the om-bootstrap.server
namespace. Fire up the webapp by running (-main)
. You can access the dev site at http://localhost:8080
. (Set the PORT
environment variable to customize the launch port.)
Next, require the repl
namespace and boot the Clojurescript repl:
(require '[om-bootstrap.repl :as repl])
(repl/repl!)
This will start a Websocket repl using Weasel. When you reload http://localhost:8080
, it should automatically connect to Weasel and anything you type at the repl will start evaluating.
I personally like to start the repl with lein repl :headless
and do all of this from Emacs. Whatever floats your boat.
Om-Bootstrap works with the following dependencies:
- Clojure 1.6.x
- React.JS 0.11.x
- Om 0.7.x
- Bootstrap 3.1.x (probably works on 3.2, haven't tested it)
and the latest version of ClojureScript. Please create a GitHub issue if you run into problems with these versions or would like to see further versions supported.
- Sam Ritchie https://twitter.com/sritchie
- Dave Petrovics https://github.com/dpetrovics
We'd love to add your name to this list! See CONTRIBUTING.md
for information on how to help out.
This project may grow large enough for its own mailing list someday, but for now please feel free to join the Clojure mailing list to ask questions or discuss how you're using Om-Bootstrap.
For announcements of new releases, you can follow @RaceHubHQ on Twitter.
We welcome contributions in the form of bug reports and pull requests! Please see CONTRIBUTING.md
in the repo root for guidelines.
To run the ClojureScript tests, simply run lein test
in the project root. Leiningen will build the relevant Clojurescript files and run all tests for you. You must have PhantomJS installed for the tests to run.
If you fork this project and would like to deploy a version of the documentation site to Heroku to show off, all you need to do is click this button:
And boom! Heroku will guide you through the process of deploying a fresh copy of http://om-bootstrap.herokuapp.com
.
HUGE thanks to the react-bootstrap project, which I used as a reference when creating all components and the documentation site.