Account

Originals

Creative

Jelly Switch

The knob stretches as it travels, squashes when it lands and wobbles before settling. Holding it squeezes it. For settings with personality.

Install

Included with Creative: needs your API key. Initialize and log in once.

Terminal
npx @galactrex/ui add jelly-switch

Usage

Example
import { JellySwitch } from "@/components/galactrex/jelly-switch";

<JellySwitch label="Sound effects" showLabel defaultChecked />

Source

Installs to components/galactrex/jelly-switch.tsx, with the shared motion primitives beside it.

Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.

See plans

Props

PropTypeDefaultDescription
labelstring—What it switches.
checked / defaultCheckedboolean—Controlled or initial state.
onChange(checked: boolean) => void—Called on toggle.
disabledboolean—Disables it.
showLabelbooleanfalseShow the label beside it.
classNamestring—Extra classes for the outer element.

Variants

  • Setting. With a visible label in a list.
  • Bare. Label for assistive tech only.

Accessibility

  • role=switch with aria-checked; Space and Enter toggle it.

Motion and reduced motion

  • Spring travel plus squash-and-stretch keyframes on the knob.
  • Reduced motion: it slides without the wobble.