Iconography
General
Jhana UI uses a unified, customizable and variable icon syntax, that all components understand. There are four ways to define an SVGIcon. Allowing for more and more features. Depending on how complex your requirements are. No matter which option, you will never specify the SVG tag. Instead, all of thsese will require you to define the SVGViewBox.
Icon defaults to currentColor: the SVG element's computed CSS text color, normally inherited from its parent. Omit color to follow text in buttons, selected cards and ordinary content, including changes on hover or focus. Set color, hover or active only when the icon needs its own colors. See the button examples.
Choosing Material Symbols
Reuse Jhana's existing icons first. For a new Material symbol, the author's preset is Material Symbols Rounded, weight 500, fill 0, grade 0 and optical size 24. Keep all five settings. Google's default weight 400 is thinner. Material's unfilled designs are still filled SVG paths, so preserve the downloaded path instead of adding a stroke or changing its thickness. Existing custom icons keep their own geometry.
Agents can retrieve the exact SVG directly from Google's official repository using this URL pattern. Replace both symbol placeholders with the Google symbol's snake_case name. Preserve its viewBox, and set the display size on Icon separately. The complete agent contract ships in docs/icons.md, including source retrieval and migration instructions.
Reactivity
Icon normally follows its parent's text color, including interaction states. For independent hover, active and focus-visible colors, put icon-root on the owning button or input label. Active means the pressed state, not an active CSS class. Native disabled roots do not trigger these interaction colors.
Filled Icons
You specify the SVG path ('d' Attribute). Which will be filled with the correct color, depending on the context. Since SVG paths can contain multiple subpaths, any mono-color filled icon can be defined like this.
Stroked Icons
You specify the SVG path ('d' Attribute). Which will be stroked with the correct color, depending on the context. You can optionally set the stroke-width. Since SVG paths can contain multiple subpaths, any mono-color single-stroke-width icon can be defined like this.
Custom SVG Icons
In case you need to use different opacities for different icon elements, or you want to use SVG shapes like circle, or some other advanced stuff, you are free to use this syntax. You have access to many CSS variables, so you can use any custom logic, while still being variable and unaware of the context. You must not include the SVG tag itself here, only its contents.
Use var(--cIcon) for fills and strokes that should follow Icon's inherited color and explicit interaction colors. This also applies to snippet icons. Hardcoded colors inside custom SVG content remain unchanged.
Custom Snippet Icons
If you require the features from the 'SVG Icon' syntax, but want to integrate Svelte reactivity or you simply prefer having syntax highlighting, type checking and autocomplete, you might want to use Svelte snippets. In addition to having access to the same CSS variables, you can also use the snippet's props and do JS calculations or Svelte conditionals with them. The downside here, is that you will have to define the icon inside a Svelte component.