Plugins
Covers Engine Plugin SDK 2.0.0 · Interface Plugin SDK 0.2.0
Toggle
Toggle using the host's pressed-state actions presentation.
Import
import { Toggle } from "@dartwic/interface-sdk/ui";Declaration
export const Toggle: HostComponent<ToggleProps>;ToggleProps
Pressed-state toggle button.
export interface ToggleProps extends HostComponentProps {
pressed?: boolean;
defaultPressed?: boolean;
onPressedChange?: (pressed: boolean) => void;
variant?: "default" | "outline";
size?: "default" | "sm" | "lg";
disabled?: boolean;
}| Prop | Type | Requirement | Description |
|---|---|---|---|
pressed | boolean | Optional | |
defaultPressed | boolean | Optional | |
onPressedChange | (pressed: boolean) => void | Optional | |
variant | "default" | "outline" | Optional | |
size | "default" | "sm" | "lg" | Optional | |
disabled | boolean | Optional | |
className | string | Optional | Additional Tailwind or host CSS classes. |
children | HostNode | Optional | Child content rendered by the host component. |
id | string | Optional | Optional DOM identifier. |
style | Record<string, unknown> | Optional | Inline style values passed to the host component. |