Liking cljdoc? Tell your friends :D

charm.components.text-input

Text input component with cursor movement and editing.

Usage: (def my-input (text-input :prompt "Name: "))

;; In update function: (text-input-update my-input msg)

;; In view function: (text-input-view my-input)

Text input component with cursor movement and editing.

Usage:
  (def my-input (text-input :prompt "Name: "))

  ;; In update function:
  (text-input-update my-input msg)

  ;; In view function:
  (text-input-view my-input)
raw docstring

blurclj

(blur input)

Blur (unfocus) the input.

Blur (unfocus) the input.
sourceraw docstring

cursor-endclj

(cursor-end input)

Move cursor to end of input.

Move cursor to end of input.
sourceraw docstring

cursor-startclj

(cursor-start input)

Move cursor to start of input.

Move cursor to start of input.
sourceraw docstring

echo-noneclj

source

echo-normalclj

source

echo-passwordclj

source

focusclj

(focus input)

Focus the input.

Focus the input.
sourceraw docstring

focused?clj

(focused? input)

Check if input is focused.

Check if input is focused.
sourceraw docstring

positionclj

(position input)

Get cursor position.

Get cursor position.
sourceraw docstring

resetclj

(reset input)

Clear the input value.

Clear the input value.
sourceraw docstring

set-valueclj

(set-value input v)

Set the value and move cursor to end.

Set the value and move cursor to end.
sourceraw docstring

text-inputclj

(text-input &
            {:keys [prompt placeholder value echo-mode echo-char char-limit
                    width prompt-style text-style placeholder-style cursor-style
                    focused id]
             :or {prompt "> "
                  value ""
                  echo-mode :normal
                  echo-char \*
                  char-limit 0
                  width 0
                  focused true
                  id (rand-int 1000000)}})

Create a text input component.

Options: :prompt - Prompt string (default "> ") :placeholder - Placeholder text when empty :value - Initial value (default "") :echo-mode - :normal, :password, or :none (default :normal) :echo-char - Character for password mode (default *) :char-limit - Maximum characters (0 = unlimited) :width - Display width (0 = unlimited) :prompt-style - Style for prompt :text-style - Style for text :placeholder-style - Style for placeholder :cursor-style - Style for cursor :focused - Start focused (default true) :id - Unique ID

Create a text input component.

Options:
  :prompt           - Prompt string (default "> ")
  :placeholder      - Placeholder text when empty
  :value            - Initial value (default "")
  :echo-mode        - :normal, :password, or :none (default :normal)
  :echo-char        - Character for password mode (default \*)
  :char-limit       - Maximum characters (0 = unlimited)
  :width            - Display width (0 = unlimited)
  :prompt-style     - Style for prompt
  :text-style       - Style for text
  :placeholder-style - Style for placeholder
  :cursor-style     - Style for cursor
  :focused          - Start focused (default true)
  :id               - Unique ID
sourceraw docstring

text-input-initclj

(text-input-init input)

Initialize the text input, returns [input cmd]. Currently just returns the input with no command.

Initialize the text input, returns [input cmd].
Currently just returns the input with no command.
sourceraw docstring

text-input-updateclj

(text-input-update input msg)

Update text input state based on a message. Returns [new-input cmd] or [input nil] if message not handled.

Update text input state based on a message.
Returns [new-input cmd] or [input nil] if message not handled.
sourceraw docstring

text-input-viewclj

(text-input-view input)

Render the text input to a string.

Render the text input to a string.
sourceraw docstring

valueclj

(value input)

Get the current value as a string.

Get the current value as a string.
sourceraw docstring

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