Skip to main content
Switch
@coinbase/cds-web@8.47.1
A control for toggling between on and off.
import { Switch } from '@coinbase/cds-web/controls/Switch'
Peer dependencies
  • framer-motion: ^10.18.0
Related components
Loading...

Customizing Colors

Like other control components (i.e. Radio, Checkbox), you can customize the color of the Switch by setting the controlColor prop.

Loading...

For more advanced color customization, you can use additional style props like background, borderColor, borderWidth, and color:

Loading...

Elevation

You can add a drop shadow to the Switch thumb using the elevation prop. By default, the Switch has no elevation.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.