Skip to content
  • Android
  • iOS
  • Web

Switch

A Switch component allows users to toggle between two states. Built on top of heroui-native Switch.

Live examples

Example.tsx

Attributes

NSwitch attributes
NameTypeDefaultDetails
enabledbooleanOptional
defaultCheckedbooleanOptional
labelstringOptional
classNamestringOptionalSupported Tailwind-style utilities, resolved entirely in Rust. See the engine README.
labelClassNamestringOptional
onChange((value: boolean) => void)Optional
idstringOptional
checkedbooleanOptional
disabledbooleanOptional
valuebooleanOptional
Engine reference for SwitchSet up engine components

Tags