logo-icon
STW UI

Swap

Swap allows you to toggle the visibility of two elements using a checkbox or a class name.

Usage

svelte
import { Swap } from 'stwui';
// OR
import Swap from 'stwui/swap'; // for tree shaking

Default (Spin)

Flip

Swap Props

type 'rotate' | 'flip' rotate
loading false | true | undefined
swapped false | true | undefined

Swap Slots

on
off

Swap Class Identifiers

stwui-swap