• Get Started
    • Introduction
    • Installation
    • Theming
  • Layout
    • Drawer
    • Footer
    • Hero
    • Indicator
    • Join
    • Stack
    • Divider
  • Navigation
    • Breadcrumbs
    • Dock
    • Menu
    • Link
    • Navbar
    • Pagination
    • Steps
    • Tabs
  • Data Display
    • Accordion
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Chat
    • Collapse
    • Countdown
    • Diff
    • Kbd
    • List
    • Mask
    • Mockup
    • Stat
    • Table
    • Timeline
  • Feedback
    • Alert
    • Loading
    • Modal
    • Progress
    • Skeleton
    • Status
    • Toast
    • Tooltip
  • Forms
    • Button
    • Checkbox
    • Dropdown
    • File Input
    • Fieldset
    • Filter
    • Input
    • Label
    • Radio
    • Range
    • Rating
    • Select
    • Toggle
    • Textarea
  • Effects
    • Hover 3D Card
    • Hover Gallery
    • Speed Dial
    • Swap
    • Text Rotate
    • Theme Controller
jsx daisyUI

    No recently viewed docs

  • Get Started
    • Introduction
    • Installation
    • Theming
  • Layout
    • Drawer
    • Footer
    • Hero
    • Indicator
    • Join
    • Stack
    • Divider
  • Navigation
    • Breadcrumbs
    • Dock
    • Menu
    • Link
    • Navbar
    • Pagination
    • Steps
    • Tabs
  • Data Display
    • Accordion
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Chat
    • Collapse
    • Countdown
    • Diff
    • Kbd
    • List
    • Mask
    • Mockup
    • Stat
    • Table
    • Timeline
  • Feedback
    • Alert
    • Loading
    • Modal
    • Progress
    • Skeleton
    • Status
    • Toast
    • Tooltip
  • Forms
    • Button
    • Checkbox
    • Dropdown
    • File Input
    • Fieldset
    • Filter
    • Input
    • Label
    • Radio
    • Range
    • Rating
    • Select
    • Toggle
    • Textarea
  • Effects
    • Hover 3D Card
    • Hover Gallery
    • Speed Dial
    • Swap
    • Text Rotate
    • Theme Controller

© 2026 jsx-daisyui. All rights reserved. | Built with DaisyUI and React.

Swap

Swap is used to toggle between two states with an optional animation effect.

Installation
npx jsx-daisyui add swap

Default

swap-default

Rotate effect

swap-rotate

Flip effect

swap-flip

Text toggle

swap-text

Controlled

swap-controlled

Sound: off


Props

SwapRoot

PropTypeDefaultDescription
effect'rotate' | 'flip'-The animation effect when swapping states.
activeboolean-Forces the active state regardless of internal checked state.
checkedboolean-The controlled checked state.
defaultCheckedboolean-The default checked state when uncontrolled.
onChange(checked: boolean) => void-Callback when the swap state changes.