diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md b/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md index 776fa7633bdff72b2669c2eeddbb292972a5760b..a017cb09fb745106ca7b50f64a8a60f507942de0 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md @@ -1,7 +1,7 @@ # Toggle -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. @@ -20,14 +20,14 @@ None Toggle(options: { type: ToggleType, isOn?: boolean }) - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | | type | ToggleType | Yes | - | Type of the toggle. | - | isOn | boolean | No | false | Initial state of the toggle.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If **isOn** is not set during component creation, the selected state can be retained during component reuse. If **isOn** is set, the selected state needs to be retained during component reuse after the selected state is recorded using an event method. | + | isOn | boolean | No | false | Initial state of the toggle.
> **NOTE**
> If **isOn** is not set during component creation, the selected state can be retained during component reuse. If **isOn** is set, the selected state needs to be retained during component reuse after the selected state is recorded using an event method. | - ToggleType enums - | Name | Description | + | Name | Description | | -------- | -------- | | Checkbox | A checkbox is provided. The text setting of the child component does not take effect. If the text setting is required, you can place the **<Text>** component and the current component in the layout component. | | Button | A button is provided. If the text setting is available, the corresponding text content is displayed inside the button. | @@ -36,15 +36,15 @@ Toggle(options: { type: ToggleType, isOn?: boolean }) ## Attributes - | Name | Type | Default Value | Description | +| Name | Type | Default Value | Description | | -------- | -------- | -------- | -------- | | selectedColor | Color | - | Background color of the toggle when it is enabled. | -| switchPointColor | Color | - | Color of the circular slider of the **Switch** type.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This attribute is valid only when type is set to **ToggleType.Switch**. | +| switchPointColor | Color | - | Color of the circular slider of the **Switch** type.
> **NOTE**
> This attribute is valid only when type is set to **ToggleType.Switch**. | ## Events - | Name | Description | +| Name | Description | | -------- | -------- | | onChange(callback: (isOn: boolean) => void) | Triggered when the switch status changes. |