Drop-in replacement for re-com.core with a few changes.
Drop-in replacement for `re-com.core` with a few changes.
(case x & clauses)Similar to clojure.core/case, but wraps the values in divs.
Values that aren't displayed will still be returned, but they'll be wrapped
in a div with :display "none" for performance.
Example:
(def tab (reagent.core/ratom ::tab-1))
(case @tab
::tab-1 [:p "tab 1"]
::tab-2 [:p "tab 2"])
=> [:div
(^{:key ::tab-1} [:div [:p "tab 1"]]
^{:key ::tab-2} [:div {:style {:display "none"}}
[:p "tab 2"]])]
Similar to `clojure.core/case`, but wraps the values in divs.
Values that aren't displayed will still be returned, but they'll be wrapped
in a div with `:display "none"` for performance.
Example:
```
(def tab (reagent.core/ratom ::tab-1))
(case @tab
::tab-1 [:p "tab 1"]
::tab-2 [:p "tab 2"])
=> [:div
(^{:key ::tab-1} [:div [:p "tab 1"]]
^{:key ::tab-2} [:div {:style {:display "none"}}
[:p "tab 2"]])]
```(for bindings body)Like for, but avoids React's complaints about unique keys.
Like `for`, but avoids React's complaints about unique keys.
(gap & {:as props})Like re-com.core/gap, but with a default :size of 10px.
Like `re-com.core/gap`, but with a default `:size` of `10px`.
(horizontal-tabs & {:keys [model] :as props})Like re-com.core/horizontal-tabs, but stores :on-change results in model.
Like `re-com.core/horizontal-tabs`, but stores `:on-change` results in `model`.
(input-text & {:keys [model transform] :or {transform identity} :as props})Like re-com.core/input-text, but stores :on-change results in model.
model: an atomtransform: a function that will wrap :on-change values before they're
stored in model.Like `re-com.core/input-text`, but stores `:on-change` results in `model`. - `model`: an atom - `transform`: a function that will wrap `:on-change` values before they're stored in `model`.
Like re-com.core/v-box but without map destructuring.
Example:
[v-box {:style {:width "200px"}}
[child-component-1]
[child-component-2]]
Like `re-com.core/v-box` but without map destructuring.
Example:
```
[v-box {:style {:width "200px"}}
[child-component-1]
[child-component-2]]
```cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |