Press the switch (or Space on it) to turn the digest on and off; switch its size and disable it from the panel. Nothing is saved: the switch only says its state.
When to use
An on/off control for a setting that takes effect at once.
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Switch on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.
Terminal
npx shadcn@4.23.1 add @goop/trail-switch
PROMPT
Add the Goop Switch to this project. The install steps are at https://goop.so/docs/install.md
height, width, corner, background, text, motion: add no class for these.
API reference
Options
Option
Type
What it does
size
md | sm = md
onCheckedChange?
(checked: boolean) => void
Called after onChange with the switch's new state.
checked?
boolean
defaultChecked?
boolean
onChange?
(event: ChangeEvent<HTMLInputElement>) => void
value?
string
name?
string
required?
boolean
disabled?
boolean
form?
string
State: checked (checked / defaultChecked / onCheckedChange); drawn by data-dragging
Class recipes (cva): switchVariants (Switch)
data-slot values (to select a part by): switch
Keyboard
Key
What it does
Space
Toggle
Accessibility
The native element answers the keyboard.
hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
State
Drawn by
dragging
the attribute data-dragging
checked
the prop defaultChecked
disabled
the prop disabled
Motion
The part sets its own motion: add no transition or animation of your own.
How the theme moves, and how to move your own parts the same way: Motion.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.
goop.so/themes/trail/components/switch.md · the page as Markdown