syncfusion-maui-switch

$npx mdskill add syncfusion/maui-ui-components-skills/syncfusion-maui-switch

Implement and customize Syncfusion .NET MAUI Switch controls.

  • Toggle binary states with on, off, and indeterminate support.
  • Depends on Syncfusion .NET MAUI toolkit (SfSwitch).
  • Uses state change events and visual state manager for customization.
  • Returns a configured switch control with custom colors, icons, and sizes.

SKILL.md

.github/skills/syncfusion-maui-switchView on GitHub ↗
---
name: syncfusion-maui-switch
description: Implements and customize Syncfusion .NET MAUI Switch (SfSwitch) controls. Use when working with switches, toggle switches, on/off controls, or binary state controls in .NET MAUI applications. Covers switch customization (colors, sizes, icons), state changes, indeterminate states, and visual state managers.
metadata:
  author: "Syncfusion Inc"
  version: "34.1.29"
---

# Implementing Syncfusion .NET MAUI Switch (SfSwitch)

The Syncfusion .NET MAUI Switch (SfSwitch) control provides an efficient way to toggle between states with rich customization options, multiple state support, and advanced visual styling capabilities.

## When to Use This Skill

Use this skill when you need to:
- Implement toggle switches or on/off controls in .NET MAUI applications
- Create binary state controls with visual feedback
- Implement indeterminate states for work-in-progress scenarios
- Customize switch appearance (colors, sizes, corner radius, borders)
- Add custom icons or paths inside the switch thumb
- Handle state change events with validation or cancellation logic
- Apply advanced styling using Visual State Manager
- Support right-to-left (RTL) layouts for internationalization
- Implement modern UI effects like liquid glass morphism
- Provide accessible toggle controls with visual state feedback

## Component Overview

The SfSwitch control offers:
- **Multiple States:** On, Off, Indeterminate, and their disabled variants
- **Rich Customization:** Colors, sizes, borders, corner radius, and custom icons
- **Event Handling:** StateChanged and StateChanging events with cancellation support
- **Visual State Manager:** Advanced state-based styling for hovered, pressed, and disabled states
- **Modern Features:** Liquid glass effect for premium UI experiences
- **RTL Support:** Bidirectional layout support for global applications
- **Theming:** Material, Cupertino, and Fluent design themes

## Documentation and Navigation Guide

### Getting Started
📄 **Read:** [references/getting-started.md](references/getting-started.md)

Use this when you need to:
- Install the Syncfusion.Maui.Buttons NuGet package
- Register the handler with ConfigureSyncfusionCore
- Create your first basic switch implementation
- Set up switch in both XAML and C#
- Perform actions based on state changes

### Switch States
📄 **Read:** [references/switch-states.md](references/switch-states.md)

Use this when you need to:
- Understand all available switch states
- Implement On, Off, and default states
- Enable and use indeterminate state (IsOn = null)
- Create disabled state variants (disabled On/Off/Indeterminate)
- Control state transitions programmatically
- Set initial state values

### Events
📄 **Read:** [references/events.md](references/events.md)

Use this when you need to:
- Handle state change notifications (StateChanged event)
- Validate or cancel state transitions (StateChanging event)
- Access old and new state values in event handlers
- Implement conditional state changes
- Trigger actions when switch state changes
- Prevent unwanted state transitions

### Customization
📄 **Read:** [references/customization.md](references/customization.md)

Use this when you need to:
- Customize track and thumb colors
- Adjust switch dimensions (width, height)
- Configure border colors and thickness
- Set corner radius for rounded appearance
- Add custom icons or paths to the thumb
- Apply different colors to different states
- Create branded or themed switch designs

### Visual State Manager
📄 **Read:** [references/visual-state-manager.md](references/visual-state-manager.md)

Use this when you need to:
- Apply advanced state-based styling
- Customize hovered state appearance (OnHovered, OffHovered, IndeterminateHovered)
- Style pressed states (OnPressed, OffPressed, IndeterminatePressed)
- Configure disabled state visuals (OnDisabled, OffDisabled, IndeterminateDisabled)
- Implement complex visual transitions
- Create interactive hover and press effects

### Advanced Features
📄 **Read:** [references/advanced-features.md](references/advanced-features.md)

Use this when you need to:
- Enable liquid glass effect for modern UI (EnableLiquidGlassEffect)
- Implement right-to-left (RTL) layout support
- Support bidirectional layouts for internationalization
- Apply glass morphism effects over vibrant backgrounds
- Handle platform-specific features (.NET 10+, iOS 26, macOS 26)

More from syncfusion/maui-ui-components-skills

SkillDescription
syncfusion-maui-accordionImplements Syncfusion .NET MAUI Accordion (SfAccordion) - a vertically collapsible panel with stacked headers for expanding/collapsing content. Use when working with accordions, collapsible panels, expandable lists, employee lists with details, or FAQ sections in .NET MAUI applications. Covers AccordionItem configuration, expand modes, and grouped content display.
syncfusion-maui-ai-assistviewImplements Syncfusion .NET MAUI AI AssistView (SfAIAssistView) for AI-powered interactive chat interfaces. Use when working with AI chat interfaces, AI AssistView, SfAIAssistView, conversational UI, or chat with AI responses. Covers integrating AI services, creating chat UIs, implementing conversation flows, managing AI requests/responses, and displaying AI suggestions.
syncfusion-maui-autocompleteImplements and configure Syncfusion .NET MAUI Autocomplete (SfAutocomplete) control for intelligent text input with suggestions. Use when implementing autocomplete, autosuggest, type-ahead search, smart search, or filtered dropdowns in .NET MAUI applications. Covers data binding, filtering modes, custom search logic, AI-powered search, multi-selection with tokens, and UI customization.
syncfusion-maui-avatar-viewImplements Syncfusion .NET MAUI Avatar View (SfAvatarView) for displaying user profile pictures, initials, or group avatars. Use when working with avatar views, profile pictures, user images, initials display, profile icons, or contact images. Ideal for implementing user profile displays, contact lists, chat interfaces, or social feeds.
syncfusion-maui-backdropImplements Syncfusion .NET MAUI Backdrop Page (SfBackdropPage) with back layer and front layer surfaces. Use when working with backdrop pages, SfBackdropPage, back layer, front layer, or reveal/conceal animations. Covers backdrop navigation patterns, header icons, corner shapes, reveal height, layer state events, and liquid glass effect.
syncfusion-maui-badge-viewImplements Syncfusion .NET MAUI Badge View (SfBadgeView) control. Use when adding badge notifications, status indicators, unread counts, or notification overlays to MAUI applications. Covers SfBadgeView setup, badge text customization, position adjustments, animations, predefined symbols, and accessibility features.
syncfusion-maui-barcode-generatorImplements Syncfusion .NET MAUI Barcode Generator (SfBarcodeGenerator) for generating machine-readable barcodes. Use when working with barcodes, barcode generation, QR codes, data matrix, EAN codes, UPC codes, Code128, or Code39. This skill covers both one-dimensional (linear) and two-dimensional (matrix) barcode symbologies with extensive customization options.
syncfusion-maui-busy-indicatorImplements Syncfusion .NET MAUI Busy Indicator (SfBusyIndicator) for showing loading states, data processing, and app activity indicators. Use when displaying loading indicators, busy animations, activity spinners, or processing feedback in .NET MAUI apps. Covers busy indicator setup, animations, and visual feedback during long-running operations.
syncfusion-maui-buttonImplements and customize Syncfusion .NET MAUI Button (SfButton) control. Use when working with MAUI buttons, SfButton implementation, button customization, or visual states. Covers button icons, background images, RTL support, Liquid Glass effects, custom button views, button styling, events, and checkable buttons.
syncfusion-maui-calendarImplements and customize Syncfusion .NET MAUI Calendar (SfCalendar) control. Use when implementing calendar functionality, date selection (single, multiple, range), or calendar views (month, year, decade, century). Covers date restrictions (min/max dates, EnablePastDates, SelectableDayPredicate), calendar customization, events (ViewChanged, SelectionChanged, Tapped), and header/footer customization.