Draft UI

Switch

A text field allows a user to enter a plain text value with a keyboard.

Installation

bash
npx @sly-cli/sly add draft-ui switch

Examples

Default

The default Switch uses size md.

Alignment

Switches can be either left or right aligned.

Sizes

You can use the size prop to alter the Switch size. Sizes sm, md, and lg are included by default.

Disabled

Use the isDisabled prop to make the Switch disabled.