docs/utilities/swap
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
Animate between two visual states with smooth transitions.
PreviewCode
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/swap
import {
Swap,
SwapIndicator
} from "@/registry/react/components/swap";
<Swap>
<SwapIndicator type="on">
<MoonIcon />
</SwapIndicator>
<SwapIndicator type="off">
<SunIcon />
</SwapIndicator>
</Swap>
PreviewCode
PreviewCode
PreviewCode
PreviewCode
PreviewCode
| Prop | Type | Default |
|---|---|---|
variant | `"fade" | "scale" |
swap | boolean | - |
lazyMount | boolean | true |
unmountOnExit | boolean | true |
className | string | - |
asChild | boolean | - |
| Prop | Type | Default |
|---|---|---|
type | `'on' | 'off'` |
className | string | - |
asChild | boolean | - |
For a complete list of props, see the Ark UI documentation.
[
Previous page
Show ](/docs/utilities/show)[
Next page
Formisch ](/docs/forms/formisch)
On This Page
InstallationUsageExamplesFadeFlipRotateScaleBlurAPI ReferenceSwapSwapIndicator