API reference
Every prop, method and entry point of the PulsoIcon packages.
Props
The same on every platform, with the same defaults. Kotlin and Swift spell the types their own way.
| Prop | Type | Default | What it does |
|---|---|---|---|
size |
number | string |
24 |
Width and height |
color |
string |
currentColor |
Stroke colour, and fill colour when solid |
strokeWidth |
number | string |
2 |
Stroke width on the 24-unit grid |
absoluteStrokeWidth |
boolean |
false |
Keep the stroke the same number of pixels at any size |
solid |
boolean |
false |
Filled icon instead of outline |
animated |
boolean |
true |
false: nothing plays it, not the handle and not play |
autoAnimated |
boolean |
true |
The hover / focus trigger; false leaves the handle and play |
play |
boolean |
true plays the motion, false returns to rest |
Handle
| Method | Returns | What it does |
|---|---|---|
startAnimation() |
Promise<void> |
Plays the motion; resolves when it has finished. Does nothing with reduced motion or animated={false} |
stopAnimation() |
Promise<void> |
Returns to the resting frame; resolves when it is there |
React: ref + IconHandle. Vue: template ref + IconHandle. Svelte: bind:this. Compose: rememberPulsoIconHandle(), suspending methods. SwiftUI: PulsoIconHandle, async methods.
Web entry points
| Import | What |
|---|---|
pulsoicon-react (-vue, -svelte) |
Every icon by name, also with an Icon suffix, plus RECIPES, types |
…/icons/<name> |
One icon by its kebab-case name |
…/names |
ICON_NAMES and the IconName type, without loading any icon |
…/all |
ICONS (every icon by kebab-case name) and ICON_NAMES; loads every icon |
pulsoicon-core |
The icon data, recipes and framework-free player shared by the web packages |
React also exports createIcon, DistributiveOmit, BaseIconProps, AnimationProps, IconProps and PulsoIcon.
Markup
Each icon renders <svg class="pulsoicon pulsoicon-<name>" aria-hidden="true">, viewBox 0 0 24 24, round caps and joins. Other attributes go on the <svg>.
Native
- Compose:
PulsoIcon(icon, contentDescription, …)— see Jetpack Compose. - SwiftUI:
PulsoIconView(_:size:…)— see SwiftUI.