A single button used to switch between two states, such as on/off or bold/not bold formatting.
Import the Toggle
component from @bun-ui/react
and use it in your project:
import { Toggle } from "@bun-ui/react"
<Toggle aria-label="Toggle bold">
<Bold />
</Toggle>
Use pressed
and onPressedChange
to manage the toggle state manually:
The size
prop can be used to set the size of the toggle button.
The available sizes are sm
, md
, and lg
. The default size is md
.