Skip to content

Commit

Permalink
[#638] Update switches documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea committed Oct 13, 2023
1 parent b7de95b commit 72bdcfc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
13 changes: 11 additions & 2 deletions docs/components/Switches.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ description: Switch selection control allows the user to select options.
Switches toggle the state of a single setting on or off. They are the preferred
way to adjust settings on mobile.

---

<br>
**Page Summary**

* [Specifications references](#specifications-references)
Expand Down Expand Up @@ -48,6 +47,16 @@ OdsSwitch(
)
```

#### OdsSwitch API

Parameter | Default value | Description
-- | -- | --
`checked: Boolean` | | Controls the checked state of the switch
`onCheckedChange: ((Boolean) -> Unit)?` | | Callback invoked on switch check. If `null`, then this is passive and relies entirely on a higher-level component to control the "checked" state.
`modifier: Modifier` | `Modifier` | `Modifier` applied to the switch
`enabled: Boolean` | `true` | Controls the enabled state of the switch. When `false`, the switch will not be checkable and appears disabled.
{:.table}

## Component specific tokens

_Soon available_
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ import com.orange.ods.compose.theme.OdsTheme
*
* Switches toggle the state of a single item on or off.
*
* @param checked whether or not this component is checked
* @param onCheckedChange callback to be invoked when Switch is being clicked,
* therefore the change of checked state is requested. If null, then this is passive
* and relies entirely on a higher-level component to control the "checked" state.
* @param modifier Modifier to be applied to the switch layout
* @param enabled whether the component is enabled or grayed out
* @param checked Controls the checked state of the switch
* @param onCheckedChange Callback invoked on switch check. If `null`, then this is passive and relies entirely on a higher-level component to control
* the "checked" state.
* @param modifier [Modifier] applied to the switch
* @param enabled Controls the enabled state of the switch. When `false`, the switch will not be checkable and appears disabled.
*/
@Composable
@OdsComposable
Expand Down

0 comments on commit 72bdcfc

Please sign in to comment.