Switch
A control that allows the user to toggle between checked and not checked.
Default
A basic switch component with a label.
switch-example-default.ts
Reactive Form
Switch integrated within an Angular Reactive Form.
switch-example-form.ts
Custom Colors
Applying custom Tailwind CSS classes to theme the switch's checked state.
switch-example-colors.ts
API Reference
Brain API
The brain directives provide the functional logic and state management for the switch.
| Directive | Selector | Inputs / Outputs |
|---|---|---|
| BrnSwitch | brn-switch, [brnSwitch] |
|
Helm API
The helm directives provide the default spartan/ui styling for the switch.
| Component / Directive | Selector | Description |
|---|---|---|
| HlmSwitch | hlm-switch | Main container representing the switch track. |
| HlmSwitchThumb | brn-switch-thumb[hlm] | The sliding thumb indicator. |