UI kit reference
motion/SwapIcon
import { … } from 'zidane-ui'ui/src/motion/SwapIcon.tsx
Components#
SwapIconComponent#
Glyphs stacked in one box; current shows, the others wait hidden.
Switching cross-fades (.zg-swap in primitives.css).
function SwapIcon<K extends string>(props: SwapIconProps<K>): ElementType parameters
| Name | Type | Description |
|---|---|---|
| K | extends string |
Parameters
| Name | Type | Description |
|---|---|---|
| props | SwapIconProps<K> | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the box, such as a text size. |
| current | K | Key in |
| icons | Record<K, string> | Key → icon class ( |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
SwapIconPropsInterface#
Props for SwapIcon.
interface SwapIconProps<K extends string>Type parameters
| Name | Type | Description |
|---|---|---|
| K | extends string |
Properties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the box, such as a text size. |
| current | K | Key in |
| icons | Record<K, string> | Key → icon class ( |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |