Switch

A switch allows a user to turn a setting on or off.

Installation

npx shadcn add https://hq-ui.vercel.app/r/nova/switch

Examples

Description

switch-description

Choice Card

Card-style selection where FieldLabel wraps the entire Field for a clickable card pattern.

switch-choice-card

Disabled

Add the disabled prop to the Switch component to disable the switch. Add the data-disabled prop to the Field component for styling.

switch-disabled

Invalid

Add the aria-invalid prop to the Switch component to indicate an invalid state. Add the data-invalid prop to the Field component for styling.

switch-invalid

Size

Use the size prop to change the size of the switch.

switch-sizes