name: "Checkbox Toggle" description: "A checkable input that communicates if an option is true, false or indeterminate. A toggle-style checkbox that provides a visual switch interface for binary choices." category: "Input" slds_classes: root: "slds-checkbox_toggle" elements: - class: "slds-checkbox_faux" description: "Visual toggle switch element" purpose: "Custom-styled toggle switch appearance that replaces the native checkbox" - class: "slds-checkbox_faux_container" description: "Container for the faux checkbox element and text labels" purpose: "Wraps the toggle switch and provides structure for on/off text" - class: "slds-checkbox_off" description: "Container for text shown when toggle is off" purpose: "Displays text when checkbox is unchecked" - class: "slds-checkbox_on" description: "Container for text shown when toggle is on" purpose: "Displays text when checkbox is checked" modifiers: [] states: - class: "slds-is-disabled" description: "Disabled state styling" trigger: "When checkbox toggle is not interactive" variants: - name: "Base" description: "Standard checkbox toggle" classes: - "slds-checkbox_toggle" usage_context: "Default checkbox toggle implementation" differences: "Toggle switch with optional on/off text labels" lightning_component: name: "" url: "https://developer.salesforce.com/docs/component-library/overview/components" mapping_notes: "No direct Lightning Base Component - use custom implementation with SLDS classes" accessibility: keyboard_support: - "Tab to focus the checkbox toggle" - "Space to toggle checkbox state" - "Enter may toggle in some contexts" screen_reader: - "Checkbox state announced (checked/unchecked)" - "Label text read with the checkbox" - "Required state announced when applicable" - "Error messages associated and announced" aria_attributes: - "aria-describedby for error messages" - "aria-invalid when validation fails" - "aria-required for required checkboxes" - "aria-checked for state indication" - "fieldset and legend for grouped toggles" usage_guidelines: when_to_use: - "For binary choices where toggle switch UI is preferred" - "When you want a more visual, switch-like interface" - "For settings, preferences, or feature toggles" - "When space allows for the toggle switch design" when_not_to_use: - "For mutually exclusive options (use radio buttons)" - "When multiple options can be selected (use checkboxes)" - "In very constrained spaces (use standard checkbox)" - "For actions (use buttons instead)" best_practices: - "Use clear, descriptive labels" - "Provide on/off text labels when helpful" - "Use fieldset and legend for grouped toggles" - "Ensure adequate touch target size for mobile" - "Provide immediate visual feedback for state changes" - "Use consistent toggle styling throughout the interface" common_mistakes: - "Using toggles for mutually exclusive options" - "Making labels too long or unclear" - "Not providing proper fieldset/legend structure for groups" - "Missing required state indicators" - "Inadequate spacing or touch targets" code_examples: - title: "Basic Checkbox Toggle" code: |