A switch component which follows RTK Design System.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
checked |
boolean |
✅ | - | Whether the switch is enabled/checked |
disabled |
boolean |
✅ | - | Whether switch is readonly |
iconPack |
IconPack |
❌ | defaultIconPack |
Icon pack |
readonly |
boolean |
✅ | - | Whether switch is readonly |
t |
RtkI18n |
❌ | useLanguage() |
Language |
import { RtkSwitch } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return <RtkSwitch />;
}import { RtkSwitch } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return (
<RtkSwitch
checked={true}
disabled={true}
readonly={true}
/>
);
}