Skip to main content

Toggle

Button that toggles between pressed and unpressed states

Example

toggle
Loading preview…

Toggle

Button that toggles between pressed and unpressed states

Source: packages/appkit-ui/src/react/ui/toggle.tsx

Props

PropTypeRequiredDefaultDescription
pressedboolean-The controlled state of the toggle.
defaultPressedboolean-The state of the toggle when initially rendered. Use defaultPressed if you do not need to control the state of the toggle. @defaultValue false
onPressedChange((pressed: boolean) => void)-The callback that fires when the state of the toggle changes.
asChildboolean--
variant"default" | "outline" | null--
size"default" | "sm" | "lg" | null--

Usage

import { Toggle } from '@databricks/appkit-ui';

<Toggle /* props */ />