Components
- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/swap.json.json
Usage
import { Swap, SwapIndicator } from "@/registry/react/components/swap";
<Swap> <SwapIndicator type="on"> <MoonIcon /> </SwapIndicator> <SwapIndicator type="off"> <SunIcon /> </SwapIndicator> </Swap>
Examples
Fade
Flip
Rotate
Scale
Blur
API Reference
Swap
| Prop | Type | Default |
|---|---|---|
variant | "fade" | "scale" | "flip" | "rotate" | "blur" | "fade" |
swap | boolean | - |
lazyMount | boolean | true |
unmountOnExit | boolean | true |
className | string | - |
asChild | boolean | - |
SwapIndicator
| Prop | Type | Default |
|---|---|---|
type | 'on' | 'off' | required |
className | string | - |
asChild | boolean | - |
For a complete list of props, see the Ark UI documentation.