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;
}
PropTypeRequirementDescription
pressedbooleanOptional
defaultPressedbooleanOptional
onPressedChange(pressed: boolean) => voidOptional
variant"default" | "outline"Optional
size"default" | "sm" | "lg"Optional
disabledbooleanOptional
classNamestringOptionalAdditional Tailwind or host CSS classes.
childrenHostNodeOptionalChild content rendered by the host component.
idstringOptionalOptional DOM identifier.
styleRecord<string, unknown>OptionalInline style values passed to the host component.