generated:catalog.entry.switch.title
generated:catalog.entry.switch.description
@xngui/components/switch@xngui/components/switchchrome:demo.section
chrome:demo.preview
import { Component } from '@angular/core';
import { XForm } from '@xngui/components/form';
import { XSwitch } from '@xngui/components/switch';
@Component({
selector: 'app-example',
imports: [XForm, XSwitch],
templateUrl: './switch.component.html',
})
export class ExampleComponent {}
chrome:demo.events.title
chrome:demo.events.empty
chrome:demo.api.title
x-switch
chrome:demo.api.col.property
chrome:demo.api.col.type
chrome:demo.api.col.default
chrome:demo.api.col.description
sizeXSize—Visual size tier — falls back to XConfigService when unset.
densityXDensity—Spacing offsets — orthogonal to `size`; falls back to XConfigService when unset.
variantXVariant—Checked track color role — falls back to XConfigService when unset.
labelstring''Visible label text beside the switch.
descriptionstring''Optional helper text under the label.
ariaLabelstring—Accessible name when no visible `label` is provided.
controlIdstring—Native `id` on the control; falls back to `name`, then a generated id.
disabledbooleanfalseKept in sync by `[formField]`; set directly for standalone use.
readonlybooleanfalseValue-only input — user cannot change when true.
invalidbooleanfalseMarks the control invalid for styling and ARIA.
requiredbooleanfalseMarks the control as required for validation and ARIA.
namestring''Native form control `name` attribute.