From ce60c0958500d34891ebfc407e7636598c6af7f8 Mon Sep 17 00:00:00 2001 From: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com> Date: Tue, 5 Sep 2023 23:16:23 -0500 Subject: [PATCH] switch --- docs/data/base/components/switch/switch.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/data/base/components/switch/switch.md b/docs/data/base/components/switch/switch.md index 35aee01b7870c4..d4750c12c7890f 100644 --- a/docs/data/base/components/switch/switch.md +++ b/docs/data/base/components/switch/switch.md @@ -23,8 +23,6 @@ The Switch component provides users with a switch for toggling between two mutua ## Component -### Usage - ```jsx import { Switch } from '@mui/base/Switch'; ``` @@ -63,7 +61,8 @@ The following code snippet applies a CSS class called `my-thumb` to the thumb sl #### Usage with TypeScript -In TypeScript, you can specify the custom component type used in the `slots.root` as a generic parameter of the unstyled component. This way, you can safely provide the custom root's props directly on the component: +In TypeScript, you can specify the custom component type used in the `slots.root` as a generic parameter of the unstyled component. +This way, you can safely provide the custom root's props directly on the component: ```tsx slots={{ root: CustomComponent }} customProp /> @@ -81,7 +80,7 @@ The same applies for props specific to custom primitive elements: import { useSwitch } from '@mui/base/useSwitch'; ``` -The `useSwitch` hook lets you apply the functionality of a switch to a fully custom component. +The `useSwitch` hook lets you apply the functionality of a Switch to a fully custom component. It returns props to be placed on the custom component, along with fields representing the component's internal state. Hooks _do not_ support [slot props](#custom-structure), but they do support [customization props](#customization).