ClojureScript utilities for registering icons with the ty icon system.
Usage: (ns my-app.icons (:require [ty.icons :as icons] [ty.lucide :as lucide]))
;; Register icons by name (icons/register! {:check lucide/check :heart lucide/heart :star lucide/star})
;; Or use string keys if you prefer (icons/register! {"check" lucide/check "heart" lucide/heart})
ClojureScript utilities for registering icons with the ty icon system.
Usage:
(ns my-app.icons
(:require [ty.icons :as icons]
[ty.lucide :as lucide]))
;; Register icons by name
(icons/register!
{:check lucide/check
:heart lucide/heart
:star lucide/star})
;; Or use string keys if you prefer
(icons/register!
{"check" lucide/check
"heart" lucide/heart})(register! icons-map)Register icons with the ty icon system.
Accepts a map of icon-name -> svg-string. Keys can be keywords or strings.
Example: (register! {:check lucide/check :heart lucide/heart "custom-icon" my-svg-string})
Returns true if registration succeeded, false otherwise.
Register icons with the ty icon system.
Accepts a map of icon-name -> svg-string.
Keys can be keywords or strings.
Example:
(register! {:check lucide/check
:heart lucide/heart
"custom-icon" my-svg-string})
Returns true if registration succeeded, false otherwise.(register-async! icons-map)(register-async! icons-map
{:keys [max-retries delay-ms on-success on-failure]
:or {max-retries 10 delay-ms 50}})Register icons, retrying if ty.js hasn't loaded yet.
Useful when icons.cljs loads before ty.js. Will retry up to max-retries times (default 10) with delay-ms between attempts (default 50ms).
Example: (register-async! {:check lucide/check})
Register icons, retrying if ty.js hasn't loaded yet.
Useful when icons.cljs loads before ty.js.
Will retry up to max-retries times (default 10) with delay-ms between attempts (default 50ms).
Example:
(register-async! {:check lucide/check})(registered? icon-name)Check if an icon is already registered.
Example: (when-not (registered? :check) (register! {:check lucide/check}))
Check if an icon is already registered.
Example:
(when-not (registered? :check)
(register! {:check lucide/check}))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 |