Skip to content

motion/SwapIcon

import { … } from 'zidane-ui'ui/src/motion/SwapIcon.tsx

sizes xs, sm, md, lg
active, danger, disabled
node icon, badge, render as link
IconToggle in a segment

Components#

SwapIconComponent#

Glyphs stacked in one box; current shows, the others wait hidden. Switching cross-fades (.zg-swap in primitives.css).

TypeScript
function SwapIcon<K extends string>(props: SwapIconProps<K>): Element
Type parameters
NameTypeDescription
Kextends string
Parameters
NameTypeDescription
propsSwapIconProps<K>

Component props.

Element
SwapIcon props
NameTypeDescription
className?string

Extra classes on the box, such as a text size.

currentK

Key in icons of the glyph to show.

iconsRecord<K, string>

Key → icon class (i-ph-*).

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/motion/SwapIcon.tsx:21

Interfaces#

SwapIconPropsInterface#

Props for SwapIcon.

TypeScript
interface SwapIconProps<K extends string>
SwapIconProps type parameters
NameTypeDescription
Kextends string
SwapIconProps properties
NameTypeDescription
className?string

Extra classes on the box, such as a text size.

currentK

Key in icons of the glyph to show.

iconsRecord<K, string>

Key → icon class (i-ph-*).

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/motion/SwapIcon.tsx:4