Switch

A control that allows the user to toggle between checked and not checked.

Installation

$npx maddex add Switch

Default

Start with the simple shadcn-style pattern: one label, one description, and one uncontrolled switch.

Preview

        
            
        
    

Controlled

Use checked and on-checked-change when nearby UI should stay synchronized with the current switch state.

Preview

        
            
        
    

Choice Card

Wrap the switch in a full-width card pattern when the description needs more space and the selected state should use shadcn-style blue emphasis.

Preview