Switches are used for immediate on/off settings in Aggarly Platform. They support tones, sizes, RTL-safe thumb motion, and premium settings-row alignment. For dense toolbars, label-less switches are allowed but must include aria-label.
Enterprise default. Premium track + thumb treatment with token-safe gradients and a subtle sheen.
import { Switch } from "@/design-system/components/Switch";
export function Example() {
return (
<div className="switches-list">
<Switch
ui="premium"
label="Email notifications"
description="Receive updates for session changes and supervisor notes."
defaultChecked
/>
<Switch
ui="premium"
label="Workspace member portal visibility"
description="Allow workspace members to view read-only progress summaries."
/>
<Switch
ui="premium"
label="Lock editing"
description="Requires supervisor role."
disabled
/>
</div>
);
}
Glass/neuomorphic style using token-driven translucent surfaces and blur. Use selectively for premium settings surfaces.
import { Switch } from "@/design-system/components/Switch";
export function Example() {
return (
<div className="switches-list">
<Switch
ui="glass"
tone="primary"
label="Glass mode"
description="Glass/neuomorphic switch style."
defaultChecked
/>
<Switch
ui="glass"
tone="secondary"
label="Supervisor review"
description="Require approval for plan changes."
/>
<Switch
ui="glass"
tone="neutral"
label="Advanced analytics"
description="Enable additional metrics and exports."
/>
</div>
);
}
Use tones to communicate semantic intent and align with the rest of the design system.
import { Switch } from "@/design-system/components/Switch";
export function Example() {
return (
<div className="switches-grid">
<Switch tone="primary" label="Primary" defaultChecked />
<Switch tone="secondary" label="Secondary" defaultChecked />
<Switch tone="success" label="Success" defaultChecked />
<Switch tone="warning" label="Warning" defaultChecked />
<Switch tone="danger" label="Danger" defaultChecked />
<Switch tone="neutral" label="Neutral" defaultChecked />
</div>
);
}
Use sm for compact toolbars, md for standard settings, and lg for primary configuration pages.
import { Switch } from "@/design-system/components/Switch";
export function Example() {
return (
<div className="switches-list">
<Switch size="sm" label="Small" defaultChecked />
<Switch size="md" label="Default" defaultChecked />
<Switch size="lg" label="Large" defaultChecked />
</div>
);
}
End position is the default and recommended for settings rows. Start position is useful when the control should be emphasized.
import { Switch } from "@/design-system/components/Switch";
export function Example() {
return (
<div className="switches-list">
<Switch
position="end"
label="Settings row (recommended)"
description="Label left, switch right."
defaultChecked
/>
<Switch
position="start"
label="Control-first"
description="Switch left, label right."
/>
</div>
);
}
Use for dense toolbars only. Always provide aria-label or aria-labelledby.
import { Switch } from "@/design-system/components/Switch";
export function Example() {
return (
<div className="switches-toolbar" aria-label="Toolbar toggles">
<Switch aria-label="Toggle grid view" defaultChecked />
<Switch tone="secondary" aria-label="Toggle compact mode" />
<Switch tone="neutral" aria-label="Toggle advanced filters" />
<Switch tone="danger" aria-label="Toggle lockdown mode" disabled />
</div>
);
}