Switch
A control that allows the user to toggle between checked and not checked.
import { Component } from '@angular/core';
import { HlmLabelDirective } from '@spartan-ng/ui-label-helm';
import { HlmSwitchComponent } from '@spartan-ng/ui-switch-helm';
@Component({
selector: 'spartan-switch-preview',
standalone: true,
imports: [HlmLabelDirective, HlmSwitchComponent],
template: `
<label class="flex items-center" hlmLabel>
<hlm-switch class="mr-2" />
Airplane mode
</label>
`,
})
export class SwitchPreviewComponent {}
Installation
npx nx g @spartan-ng/cli:ui switch
ng g @spartan-ng/cli:ui switch
Usage
import { HlmSwitchComponent } from '@spartan-ng/ui-switch-helm';
<hlm-switch />