---
id: fast-foundation.switch
title: Switch class
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-foundation](./fast-foundation.md) &gt; [Switch](./fast-foundation.switch.md)

## Switch class

A Switch Custom HTML Element. Implements the [ARIA switch](https://www.w3.org/TR/wai-aria-1.1/#switch)<!-- -->.


- The deafult slot for the label


checked-message - The message when in a checked state


unchecked-message - The message when in an unchecked state


label - The label


switch - The element representing the switch, which wraps the indicator


status-message - The wrapper for the status messages


checked-message - The checked message


unchecked-message - The unchecked message


change - Emits a custom change event when the checked state changes

<b>Signature:</b>

```typescript
export declare class Switch extends FormAssociatedSwitch 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)()](./fast-foundation.switch._constructor_.md) |  | Constructs a new instance of the <code>Switch</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [readOnly](./fast-foundation.switch.readonly.md) |  | boolean | When true, the control will be immutable by user interaction. See [readonly HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) for more information. |
