Liking cljdoc? Tell your friends :D

charm.core

charm.clj - A Clojure TUI library inspired by Bubble Tea.

This is the main entry point for charm.clj applications.

Example usage:

(require '[charm.core :as charm])

(defn update-fn [state msg]
  (cond
    (charm/key-match? msg "k") [(update state :count inc) nil]
    (charm/key-match? msg "j") [(update state :count dec) nil]
    (charm/key-match? msg "q") [state charm/quit-cmd]
    :else [state nil]))

(defn view [state]
  (str "Count: " (:count state) "\n\n(j/k to change, q to quit)"))

(charm/run {:init {:count 0}
            :update update-fn
            :view view})
charm.clj - A Clojure TUI library inspired by Bubble Tea.

This is the main entry point for charm.clj applications.

Example usage:
```clojure
(require '[charm.core :as charm])

(defn update-fn [state msg]
  (cond
    (charm/key-match? msg "k") [(update state :count inc) nil]
    (charm/key-match? msg "j") [(update state :count dec) nil]
    (charm/key-match? msg "q") [state charm/quit-cmd]
    :else [state nil]))

(defn view [state]
  (str "Count: " (:count state) "\n\n(j/k to change, q to quit)"))

(charm/run {:init {:count 0}
            :update update-fn
            :view view})
```
raw docstring

alt?clj

source

ansiclj

source

ansi256clj

source

batchclj

source

blackclj

source

blueclj

source

blurclj

source

cmdclj

source

create-terminalclj

source

ctrl?clj

source

cyanclj

source

defprogramcljmacro

(defprogram name & {:keys [init update view] :as opts})

Define a TUI program with init, update, and view functions.

Usage: (defprogram my-app :init {:count 0} :update (fn [state msg] ...) :view (fn [state] ...))

Define a TUI program with init, update, and view functions.

Usage:
  (defprogram my-app
    :init {:count 0}
    :update (fn [state msg] ...)
    :view (fn [state] ...))
sourceraw docstring

double-borderclj

source

echo-noneclj

source

echo-normalclj

source

echo-passwordclj

source

errorclj

source

error?clj

source

focusclj

source

get-sizeclj

source

greenclj

source

helpclj

source

help-bindingsclj

source

help-from-pairsclj

source

help-initclj

source

help-set-bindingsclj

source

help-toggle-show-allclj

source

help-updateclj

source

help-viewclj

source

hexclj

source

item-listclj

source

join-horizontalclj

source

join-verticalclj

source

key-match?clj

source

key-pressclj

source

key-press?clj

source

list-initclj

source

list-itemsclj

source

list-selectclj

source

list-selected-indexclj

source

list-selected-itemclj

source

list-set-itemsclj

source

list-updateclj

source

list-viewclj

source

magentaclj

source

mouseclj

source

mouse?clj

source

normal-borderclj

source

paginatorclj

source

paginator-initclj

source

paginator-next-pageclj

source

paginator-pageclj

source

paginator-prev-pageclj

source

paginator-set-pageclj

source

paginator-set-total-pagesclj

source

paginator-total-pagesclj

source

paginator-updateclj

source

paginator-viewclj

source

progress-barclj

source

progress-bar-stylesclj

source

progress-complete?clj

source

progress-decrementclj

source

progress-incrementclj

source

progress-initclj

source

progress-percentclj

source

progress-setclj

source

progress-updateclj

source

progress-viewclj

source

quitclj

source

quit-cmdclj

source

quit?clj

source

redclj

source

renderclj

source

rgbclj

source

rounded-borderclj

source

runclj

source

run-simpleclj

source

sequence-cmdsclj

source

shift?clj

source

spinnerclj

source

spinner-initclj

source

spinner-typesclj

source

spinner-updateclj

source

spinner-viewclj

source

spinning?clj

source

styleclj

source

styledclj

source

text-inputclj

source

text-input-blurclj

source

text-input-focusclj

source

text-input-initclj

source

text-input-resetclj

source

text-input-set-valueclj

source

text-input-updateclj

source

text-input-valueclj

source

text-input-viewclj

source

thick-borderclj

source

timerclj

source

timer-initclj

source

timer-running?clj

source

timer-startclj

source

timer-stopclj

source

timer-timed-out?clj

source

timer-timeoutclj

source

timer-toggleclj

source

timer-updateclj

source

timer-viewclj

source

whiteclj

source

window-sizeclj

source

window-size?clj

source

yellowclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close