Plugins

Covers Engine Plugin SDK 2.0.0 · Interface Plugin SDK 0.2.0

Button

Standard host button.

Import

import { Button } from "@dartwic/interface-sdk/ui";

Declaration

export const Button: HostComponent<ButtonProps>;

ButtonProps

Props accepted by the standard host button.

export interface ButtonProps extends HostComponentProps {
    /** Visual style preset. */
    variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
    /** Size preset. */
    size?: "default" | "sm" | "lg" | "icon";
    /** Render through the host's slot component. */
    asChild?: boolean;
    /** Click event handler. */
    onClick?: HostEventHandler;
    /** Disables interaction. */
    disabled?: boolean;
    /** Native button type. */
    type?: "button" | "submit" | "reset" | string;
}
PropTypeRequirementDescription
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link"OptionalVisual style preset.
size"default" | "sm" | "lg" | "icon"OptionalSize preset.
asChildbooleanOptionalRender through the host’s slot component.
onClickHostEventHandlerOptionalClick event handler.
disabledbooleanOptionalDisables interaction.
type"button" | "submit" | "reset" | stringOptionalNative button type.