Switch Field
A switch laid out as a field row with label, description, and hint or error text.
Automatically restart the service after a crash.
You can change this later.
Show codeHide code
Installation
import { SwitchField } from "@makeplane/propel/components/switch-field";Usage
import { SwitchField } from "@makeplane/propel/components/switch-field";
export default function BasicDemo() {
return (
<SwitchField
name="restartOnFailure"
label="Restart on failure"
switchSize="md"
size="lg"
description="Automatically restart the service after a crash."
hint="You can change this later."
defaultChecked
/>
);
}Examples
Sizes
switchSize (sm, md, lg) sizes the switch track; size (lg, xl, 2xl) sizes the label and helper text independently — set them together for the common case.
Show codeHide code
Disabled
Managed by your identity provider.
Disabled for this workspace plan.
Show codeHide code
Error
Passing error marks the field invalid, replaces the hint with the error text, and — while the switch is off — outlines the track with a danger ring, the same treatment Checkbox uses.
Every member must enable 2FA before joining.
Enable 2FA on your own account before enforcing it for the workspace.
Show codeHide code
Controlled
A Monday summary of activity across your projects.
Digest emails are paused.
Show codeHide code
API Reference
SwitchField
Ready-to-use switch field with label, description, and helper/error text.