Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/darkleaf/form
Form builder for reagent library
https://github.com/darkleaf/form
bootstrap4 clojure-spec clojurescript form-builder reagent reagent-components
Last synced: about 1 month ago
JSON representation
Form builder for reagent library
- Host: GitHub
- URL: https://github.com/darkleaf/form
- Owner: darkleaf
- Archived: true
- Created: 2017-05-15T19:56:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-21T12:07:43.000Z (about 7 years ago)
- Last Synced: 2024-09-19T11:13:37.673Z (about 2 months ago)
- Topics: bootstrap4, clojure-spec, clojurescript, form-builder, reagent, reagent-components
- Language: Clojure
- Homepage:
- Size: 228 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/darkleaf/form.svg?branch=master)](https://travis-ci.org/darkleaf/form)
[![Coverage Status](https://coveralls.io/repos/github/darkleaf/form/badge.svg)](https://coveralls.io/github/darkleaf/form)
[![Clojars Project](https://img.shields.io/clojars/v/darkleaf/form.svg)](https://clojars.org/darkleaf/form)# Features
+ twitter bootstrap4
+ nested forms support
+ interface for i18n engines
+ interface for validation engines
+ [clojure.spec integration](src/darkleaf/form/spec_integration.cljs)
+ complete test coverage# Demo
+ [demo](https://darkleaf.github.io/form/)
+ [demo source](test/darkleaf/form_test/demo.cljs)# Installation
```clojure
[reagent "0.7.0"]
[darkleaf/form "0.1.0"]
```# Usage example
```html
Form
app mount point
```
```clojure
(ns app
(:require
[reagent.core :as r]
[darkleaf.form.context :as ctx]
[darkleaf.form.bootstrap4 :as bootstrap]))(defn i18n-error [path error]
"some logic")(defn i18n-label [path]
"some logic")(defn form [data errors]
;; i18n is optional
(let [f (ctx/build data errors update {:error i18n-error, :label i18n-label})]
[:form
[bootstrap/text f :some-attribute-name]]))(def data {:some-attrubte-name "foo bar"})
(def errors {})(r/render [form data errors]
(.getElementById js/document "point"))
```Please see demo or tests for more examples.