Basic
Use a toggle for a single independent on/off action such as saving, starring, or muting.
Icons by @ng-icons/tabler-icons
The component library does not provide icons.
Two-state button primitive with pressed state, variants, sizing, icons, labels, and reactive forms support.
Preview
TS
import { FrToggleModule } from '@frame-ui-ng/components/toggle';HTML
<button frToggle>
<span frToggleLabel>Toggle</span>
</button>Use a toggle for a single independent on/off action such as saving, starring, or muting.
Use the outline variant when the toggle sits beside other bordered controls.
Project a label when the icon alone would be too ambiguous for the action.
Choose small, default, or large sizing to match dense toolbars or larger action rows.
Disabled toggles preserve their current state while blocking pointer and form interaction.
Bind pressed and pressedChange when parent state should own the selected value.
Current value: on
Because FrToggle implements ControlValueAccessor, it can bind directly to a boolean FormControl.
Reactive form value: enabled
Toggle spacing is logical, so icon and label rhythm follows the document direction.
Override toggle tokens on an individual control or a toolbar wrapper to tune selected states, border treatment, sizing, and motion.
Hover the toggle root, pressed state, outline variant, icon, or label to inspect the tokens that shape the control.
Use these CSS custom properties to tune toggle sizing, surface states, focus ring, disabled state, icon sizing, and transition timing.
SCSS
--frame-toggle-height: 2.25rem;
--frame-toggle-padding-x: 0.75rem;
--frame-toggle-gap: 0.5rem;
--frame-toggle-radius: var(--frame-radius-md, 0.5rem);
--frame-toggle-font-size: 0.875rem;
--frame-toggle-font-weight: 600;
--frame-toggle-bg: transparent;
--frame-toggle-color: var(--frame-foreground, #09090b);
--frame-toggle-border: transparent;
--frame-toggle-hover-bg: var(--frame-muted, #f4f4f5);
--frame-toggle-hover-color: var(--frame-foreground, #09090b);
--frame-toggle-pressed-bg: var(--frame-accent, var(--frame-muted, #f4f4f5));
--frame-toggle-pressed-color: var(--frame-accent-foreground, var(--frame-foreground, #09090b));
--frame-toggle-pressed-shadow: inset 0 1px 2px rgb(0 0 0 / 0.08);
--frame-toggle-outline-bg: var(--frame-background, #fff);
--frame-toggle-outline-border: var(--frame-border, #e5e7eb);
--frame-toggle-outline-hover-bg: var(--frame-muted, #f4f4f5);
--frame-toggle-outline-pressed-bg: var(--frame-muted, #f4f4f5);
--frame-toggle-focus-shadow: 0 0 0 3px color-mix(in srgb, var(--frame-ring, #18181b) 28%, transparent);
--frame-toggle-disabled-opacity: 0.5;
--frame-toggle-transition-duration: 160ms;
--frame-toggle-icon-size: 1rem;