Live preview

Interactive example

Loading example…

Usage

Import the component and its manager, then make it your own.

ComponentIcon
Managercreate_icon_manager

svelte

<script>
  // Import the shared stylesheet once in your application's root layout.
  import "sveltekit-ui/style.css"
  import { Icon, create_icon_manager } from "sveltekit-ui"

  const manager = create_icon_manager({
    icon_id: "check",
    color: "var(--success-t)",
    size: 2.4,
    sw: 40,
  })
</script>

<div style="display: flex; align-items: center; gap: 1rem;">
  <Icon {manager} /><span>Ready to publish</span>
</div>

API reference

Configure the manager, call its methods, and read its reactive state.

17 entries in configuration

PropertyTypeDefaultDescription
icon_idstring nullidentifies the icon to render (e.g. 'arrow', 'check', 'trashcan').
degnumber 0icon rotation in degrees
colorstring var(--g4-t)stroke color for the icon; also colors filled details such as dots
color_altstring var(--g12-t)alternate color (used in certain icons like 'sort' for ascending vs. descending). if not used, it falls back to the main color
fillstring nonesvg fill color (e.g., 'none' or a color hex)
sizenumber 2icon size in rem
swnumber 60stroke width setting for the icon; three_dots and drag_grip use circles with radius sw / 2 + 6
mlnumber 0margin-left in rem
mrnumber 0margin-right in rem
mtnumber 0margin-top in rem
mbnumber 0margin-bottom in rem
sort_statestring nullused by the 'sort' icon to highlight ascending or descending arrow: 'asc', 'desc', or null
is_shimmy_infiniteboolean falseif true, the icon keeps rotating slightly (shimmy) forever
is_shimmyableboolean falseif true, icon can be triggered to shimmy for 1s with trigger_shimmy()
movement_stiffnessnumber 0.1reserved for future motion config (svelte spring or similar)
movement_dampingnumber 0.1reserved for future motion config (svelte spring or similar)
idstring nullunique id for the icon. if not provided, a random id is generated