Backstage
    Preparing search index...

    Interface ButtonProps

    Properties for Button

    interface ButtonProps {
        "aria-controls"?: string;
        "aria-current"?:
            | boolean
            | "time"
            | "true"
            | "false"
            | "page"
            | "step"
            | "location"
            | "date";
        "aria-describedby"?: string;
        "aria-details"?: string;
        "aria-disabled"?: boolean
        | "true"
        | "false";
        "aria-expanded"?: boolean | "true" | "false";
        "aria-haspopup"?:
            | boolean
            | "dialog"
            | "menu"
            | "true"
            | "false"
            | "listbox"
            | "tree"
            | "grid";
        "aria-label"?: string;
        "aria-labelledby"?: string;
        "aria-pressed"?: boolean
        | "true"
        | "false"
        | "mixed";
        autoFocus?: boolean;
        children?: ReactNode;
        className?: ClassNameOrFunction<ButtonRenderProps>;
        dir?: string;
        excludeFromTabOrder?: boolean;
        form?: string;
        formAction?: string;
        formEncType?: string;
        formMethod?: string;
        formNoValidate?: boolean;
        formTarget?: string;
        hidden?: boolean;
        iconEnd?: ReactElement<any, string | JSXElementConstructor<any>>;
        iconStart?: ReactElement<any, string | JSXElementConstructor<any>>;
        id?: string;
        inert?: boolean;
        isDisabled?: boolean;
        isPending?: boolean;
        lang?: string;
        loading?: boolean;
        name?: string;
        onAnimationEnd?: AnimationEventHandler<HTMLButtonElement>;
        onAnimationEndCapture?: AnimationEventHandler<HTMLButtonElement>;
        onAnimationIteration?: AnimationEventHandler<HTMLButtonElement>;
        onAnimationIterationCapture?: AnimationEventHandler<HTMLButtonElement>;
        onAnimationStart?: AnimationEventHandler<HTMLButtonElement>;
        onAnimationStartCapture?: AnimationEventHandler<HTMLButtonElement>;
        onAuxClick?: MouseEventHandler<HTMLButtonElement>;
        onAuxClickCapture?: MouseEventHandler<HTMLButtonElement>;
        onBlur?: (e: FocusEvent<Element>) => void;
        onClick?: (e: MouseEvent<FocusableElement>) => void;
        onClickCapture?: MouseEventHandler<HTMLButtonElement>;
        onContextMenu?: MouseEventHandler<HTMLButtonElement>;
        onContextMenuCapture?: MouseEventHandler<HTMLButtonElement>;
        onDoubleClick?: MouseEventHandler<HTMLButtonElement>;
        onDoubleClickCapture?: MouseEventHandler<HTMLButtonElement>;
        onFocus?: (e: FocusEvent<Element>) => void;
        onFocusChange?: (isFocused: boolean) => void;
        onGotPointerCapture?: PointerEventHandler<HTMLButtonElement>;
        onGotPointerCaptureCapture?: PointerEventHandler<HTMLButtonElement>;
        onHoverChange?: (isHovering: boolean) => void;
        onHoverEnd?: (e: HoverEvent) => void;
        onHoverStart?: (e: HoverEvent) => void;
        onKeyDown?: (e: KeyboardEvent) => void;
        onKeyUp?: (e: KeyboardEvent) => void;
        onLostPointerCapture?: PointerEventHandler<HTMLButtonElement>;
        onLostPointerCaptureCapture?: PointerEventHandler<HTMLButtonElement>;
        onMouseDown?: MouseEventHandler<HTMLButtonElement>;
        onMouseDownCapture?: MouseEventHandler<HTMLButtonElement>;
        onMouseEnter?: MouseEventHandler<HTMLButtonElement>;
        onMouseLeave?: MouseEventHandler<HTMLButtonElement>;
        onMouseMove?: MouseEventHandler<HTMLButtonElement>;
        onMouseMoveCapture?: MouseEventHandler<HTMLButtonElement>;
        onMouseOut?: MouseEventHandler<HTMLButtonElement>;
        onMouseOutCapture?: MouseEventHandler<HTMLButtonElement>;
        onMouseOver?: MouseEventHandler<HTMLButtonElement>;
        onMouseOverCapture?: MouseEventHandler<HTMLButtonElement>;
        onMouseUp?: MouseEventHandler<HTMLButtonElement>;
        onMouseUpCapture?: MouseEventHandler<HTMLButtonElement>;
        onPointerCancel?: PointerEventHandler<HTMLButtonElement>;
        onPointerCancelCapture?: PointerEventHandler<HTMLButtonElement>;
        onPointerDown?: PointerEventHandler<HTMLButtonElement>;
        onPointerDownCapture?: PointerEventHandler<HTMLButtonElement>;
        onPointerEnter?: PointerEventHandler<HTMLButtonElement>;
        onPointerLeave?: PointerEventHandler<HTMLButtonElement>;
        onPointerMove?: PointerEventHandler<HTMLButtonElement>;
        onPointerMoveCapture?: PointerEventHandler<HTMLButtonElement>;
        onPointerOut?: PointerEventHandler<HTMLButtonElement>;
        onPointerOutCapture?: PointerEventHandler<HTMLButtonElement>;
        onPointerOver?: PointerEventHandler<HTMLButtonElement>;
        onPointerOverCapture?: PointerEventHandler<HTMLButtonElement>;
        onPointerUp?: PointerEventHandler<HTMLButtonElement>;
        onPointerUpCapture?: PointerEventHandler<HTMLButtonElement>;
        onPress?: (e: PressEvent) => void;
        onPressChange?: (isPressed: boolean) => void;
        onPressEnd?: (e: PressEvent) => void;
        onPressStart?: (e: PressEvent) => void;
        onPressUp?: (e: PressEvent) => void;
        onScroll?: UIEventHandler<HTMLButtonElement>;
        onScrollCapture?: UIEventHandler<HTMLButtonElement>;
        onTouchCancel?: TouchEventHandler<HTMLButtonElement>;
        onTouchCancelCapture?: TouchEventHandler<HTMLButtonElement>;
        onTouchEnd?: TouchEventHandler<HTMLButtonElement>;
        onTouchEndCapture?: TouchEventHandler<HTMLButtonElement>;
        onTouchMove?: TouchEventHandler<HTMLButtonElement>;
        onTouchMoveCapture?: TouchEventHandler<HTMLButtonElement>;
        onTouchStart?: TouchEventHandler<HTMLButtonElement>;
        onTouchStartCapture?: TouchEventHandler<HTMLButtonElement>;
        onTransitionCancel?: TransitionEventHandler<HTMLButtonElement>;
        onTransitionCancelCapture?: TransitionEventHandler<HTMLButtonElement>;
        onTransitionEnd?: TransitionEventHandler<HTMLButtonElement>;
        onTransitionEndCapture?: TransitionEventHandler<HTMLButtonElement>;
        onTransitionRun?: TransitionEventHandler<HTMLButtonElement>;
        onTransitionRunCapture?: TransitionEventHandler<HTMLButtonElement>;
        onTransitionStart?: TransitionEventHandler<HTMLButtonElement>;
        onTransitionStartCapture?: TransitionEventHandler<HTMLButtonElement>;
        onWheel?: WheelEventHandler<HTMLButtonElement>;
        onWheelCapture?: WheelEventHandler<HTMLButtonElement>;
        preventFocusOnPress?: boolean;
        size?: "small" | "medium" | Partial<Record<Breakpoint, "small" | "medium">>;
        slot?: string | null;
        style?: StyleOrFunction<ButtonRenderProps>;
        translate?: "yes" | "no";
        type?: "button" | "submit" | "reset";
        value?: string;
        variant?:
            | "primary"
            | "secondary"
            | "tertiary"
            | Partial<Record<Breakpoint, "primary" | "secondary" | "tertiary">>;
    }

    Hierarchy

    • ButtonProps
      • ButtonProps
    Index

    Properties

    aria-controls? aria-current? aria-describedby? aria-details? aria-disabled? aria-expanded? aria-haspopup? aria-label? aria-labelledby? aria-pressed? autoFocus? children? className? dir? excludeFromTabOrder? form? formAction? formEncType? formMethod? formNoValidate? formTarget? hidden? iconEnd? iconStart? id? inert? isDisabled? isPending? lang? loading? name? onAnimationEnd? onAnimationEndCapture? onAnimationIteration? onAnimationIterationCapture? onAnimationStart? onAnimationStartCapture? onAuxClick? onAuxClickCapture? onBlur? onClick? onClickCapture? onContextMenu? onContextMenuCapture? onDoubleClick? onDoubleClickCapture? onFocus? onFocusChange? onGotPointerCapture? onGotPointerCaptureCapture? onHoverChange? onHoverEnd? onHoverStart? onKeyDown? onKeyUp? onLostPointerCapture? onLostPointerCaptureCapture? onMouseDown? onMouseDownCapture? onMouseEnter? onMouseLeave? onMouseMove? onMouseMoveCapture? onMouseOut? onMouseOutCapture? onMouseOver? onMouseOverCapture? onMouseUp? onMouseUpCapture? onPointerCancel? onPointerCancelCapture? onPointerDown? onPointerDownCapture? onPointerEnter? onPointerLeave? onPointerMove? onPointerMoveCapture? onPointerOut? onPointerOutCapture? onPointerOver? onPointerOverCapture? onPointerUp? onPointerUpCapture? onPress? onPressChange? onPressEnd? onPressStart? onPressUp? onScroll? onScrollCapture? onTouchCancel? onTouchCancelCapture? onTouchEnd? onTouchEndCapture? onTouchMove? onTouchMoveCapture? onTouchStart? onTouchStartCapture? onTransitionCancel? onTransitionCancelCapture? onTransitionEnd? onTransitionEndCapture? onTransitionRun? onTransitionRunCapture? onTransitionStart? onTransitionStartCapture? onWheel? onWheelCapture? preventFocusOnPress? size? slot? style? translate? type? value? variant?

    Properties

    "aria-controls"?: string

    Identifies the element (or elements) whose contents or presence are controlled by the current element.

    "aria-current"?:
        | boolean
        | "time"
        | "true"
        | "false"
        | "page"
        | "step"
        | "location"
        | "date"

    Indicates whether this element represents the current item within a container or set of related elements.

    "aria-describedby"?: string

    Identifies the element (or elements) that describes the object.

    "aria-details"?: string

    Identifies the element (or elements) that provide a detailed, extended description for the object.

    "aria-disabled"?: boolean | "true" | "false"

    Indicates whether the element is disabled to users of assistive technology.

    "aria-expanded"?: boolean | "true" | "false"

    Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

    "aria-haspopup"?:
        | boolean
        | "dialog"
        | "menu"
        | "true"
        | "false"
        | "listbox"
        | "tree"
        | "grid"

    Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

    "aria-label"?: string

    Defines a string value that labels the current element.

    "aria-labelledby"?: string

    Identifies the element (or elements) that labels the current element.

    "aria-pressed"?: boolean | "true" | "false" | "mixed"

    Indicates the current "pressed" state of toggle buttons.

    autoFocus?: boolean

    Whether the element should receive focus on render.

    children?: ReactNode

    The children of the component. A function may be provided to alter the children based on component state.

    className?: ClassNameOrFunction<ButtonRenderProps>

    The CSS className for the element. A function may be provided to compute the class based on component state.

    dir?: string
    excludeFromTabOrder?: boolean

    Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available.

    form?: string

    The <form> element to associate the button with. The value of this attribute must be the id of a <form> in the same document. See MDN.

    formAction?: string

    The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner.

    formEncType?: string

    Indicates how to encode the form data that is submitted.

    formMethod?: string

    Indicates the HTTP method used to submit the form.

    formNoValidate?: boolean

    Indicates that the form is not to be validated when it is submitted.

    formTarget?: string

    Overrides the target attribute of the button's form owner.

    hidden?: boolean
    iconEnd?: ReactElement<any, string | JSXElementConstructor<any>>
    iconStart?: ReactElement<any, string | JSXElementConstructor<any>>
    id?: string

    The element's unique identifier. See MDN.

    inert?: boolean
    isDisabled?: boolean

    Whether the button is disabled.

    isPending?: boolean

    Whether the button is in a pending state. This disables press and hover events while retaining focusability, and announces the pending state to screen readers.

    lang?: string
    loading?: boolean
    name?: string

    Submitted as a pair with the button's value as part of the form data.

    onAnimationEnd?: AnimationEventHandler<HTMLButtonElement>
    onAnimationEndCapture?: AnimationEventHandler<HTMLButtonElement>
    onAnimationIteration?: AnimationEventHandler<HTMLButtonElement>
    onAnimationIterationCapture?: AnimationEventHandler<HTMLButtonElement>
    onAnimationStart?: AnimationEventHandler<HTMLButtonElement>
    onAnimationStartCapture?: AnimationEventHandler<HTMLButtonElement>
    onAuxClick?: MouseEventHandler<HTMLButtonElement>
    onAuxClickCapture?: MouseEventHandler<HTMLButtonElement>
    onBlur?: (e: FocusEvent<Element>) => void

    Handler that is called when the element loses focus.

    onClick?: (e: MouseEvent<FocusableElement>) => void

    Not recommended – use onPress instead. onClick is an alias for onPress provided for compatibility with other libraries. onPress provides additional event details for non-mouse interactions.

    onClickCapture?: MouseEventHandler<HTMLButtonElement>
    onContextMenu?: MouseEventHandler<HTMLButtonElement>
    onContextMenuCapture?: MouseEventHandler<HTMLButtonElement>
    onDoubleClick?: MouseEventHandler<HTMLButtonElement>
    onDoubleClickCapture?: MouseEventHandler<HTMLButtonElement>
    onFocus?: (e: FocusEvent<Element>) => void

    Handler that is called when the element receives focus.

    onFocusChange?: (isFocused: boolean) => void

    Handler that is called when the element's focus status changes.

    onGotPointerCapture?: PointerEventHandler<HTMLButtonElement>
    onGotPointerCaptureCapture?: PointerEventHandler<HTMLButtonElement>
    onHoverChange?: (isHovering: boolean) => void

    Handler that is called when the hover state changes.

    onHoverEnd?: (e: HoverEvent) => void

    Handler that is called when a hover interaction ends.

    onHoverStart?: (e: HoverEvent) => void

    Handler that is called when a hover interaction starts.

    onKeyDown?: (e: KeyboardEvent) => void

    Handler that is called when a key is pressed.

    onKeyUp?: (e: KeyboardEvent) => void

    Handler that is called when a key is released.

    onLostPointerCapture?: PointerEventHandler<HTMLButtonElement>
    onLostPointerCaptureCapture?: PointerEventHandler<HTMLButtonElement>
    onMouseDown?: MouseEventHandler<HTMLButtonElement>
    onMouseDownCapture?: MouseEventHandler<HTMLButtonElement>
    onMouseEnter?: MouseEventHandler<HTMLButtonElement>
    onMouseLeave?: MouseEventHandler<HTMLButtonElement>
    onMouseMove?: MouseEventHandler<HTMLButtonElement>
    onMouseMoveCapture?: MouseEventHandler<HTMLButtonElement>
    onMouseOut?: MouseEventHandler<HTMLButtonElement>
    onMouseOutCapture?: MouseEventHandler<HTMLButtonElement>
    onMouseOver?: MouseEventHandler<HTMLButtonElement>
    onMouseOverCapture?: MouseEventHandler<HTMLButtonElement>
    onMouseUp?: MouseEventHandler<HTMLButtonElement>
    onMouseUpCapture?: MouseEventHandler<HTMLButtonElement>
    onPointerCancel?: PointerEventHandler<HTMLButtonElement>
    onPointerCancelCapture?: PointerEventHandler<HTMLButtonElement>
    onPointerDown?: PointerEventHandler<HTMLButtonElement>
    onPointerDownCapture?: PointerEventHandler<HTMLButtonElement>
    onPointerEnter?: PointerEventHandler<HTMLButtonElement>
    onPointerLeave?: PointerEventHandler<HTMLButtonElement>
    onPointerMove?: PointerEventHandler<HTMLButtonElement>
    onPointerMoveCapture?: PointerEventHandler<HTMLButtonElement>
    onPointerOut?: PointerEventHandler<HTMLButtonElement>
    onPointerOutCapture?: PointerEventHandler<HTMLButtonElement>
    onPointerOver?: PointerEventHandler<HTMLButtonElement>
    onPointerOverCapture?: PointerEventHandler<HTMLButtonElement>
    onPointerUp?: PointerEventHandler<HTMLButtonElement>
    onPointerUpCapture?: PointerEventHandler<HTMLButtonElement>
    onPress?: (e: PressEvent) => void

    Handler that is called when the press is released over the target.

    onPressChange?: (isPressed: boolean) => void

    Handler that is called when the press state changes.

    onPressEnd?: (e: PressEvent) => void

    Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.

    onPressStart?: (e: PressEvent) => void

    Handler that is called when a press interaction starts.

    onPressUp?: (e: PressEvent) => void

    Handler that is called when a press is released over the target, regardless of whether it started on the target or not.

    onScroll?: UIEventHandler<HTMLButtonElement>
    onScrollCapture?: UIEventHandler<HTMLButtonElement>
    onTouchCancel?: TouchEventHandler<HTMLButtonElement>
    onTouchCancelCapture?: TouchEventHandler<HTMLButtonElement>
    onTouchEnd?: TouchEventHandler<HTMLButtonElement>
    onTouchEndCapture?: TouchEventHandler<HTMLButtonElement>
    onTouchMove?: TouchEventHandler<HTMLButtonElement>
    onTouchMoveCapture?: TouchEventHandler<HTMLButtonElement>
    onTouchStart?: TouchEventHandler<HTMLButtonElement>
    onTouchStartCapture?: TouchEventHandler<HTMLButtonElement>
    onTransitionCancel?: TransitionEventHandler<HTMLButtonElement>
    onTransitionCancelCapture?: TransitionEventHandler<HTMLButtonElement>
    onTransitionEnd?: TransitionEventHandler<HTMLButtonElement>
    onTransitionEndCapture?: TransitionEventHandler<HTMLButtonElement>
    onTransitionRun?: TransitionEventHandler<HTMLButtonElement>
    onTransitionRunCapture?: TransitionEventHandler<HTMLButtonElement>
    onTransitionStart?: TransitionEventHandler<HTMLButtonElement>
    onTransitionStartCapture?: TransitionEventHandler<HTMLButtonElement>
    onWheel?: WheelEventHandler<HTMLButtonElement>
    onWheelCapture?: WheelEventHandler<HTMLButtonElement>
    preventFocusOnPress?: boolean

    Whether to prevent focus from moving to the button when pressing it.

    Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.

    size?: "small" | "medium" | Partial<Record<Breakpoint, "small" | "medium">>
    slot?: string | null

    A slot name for the component. Slots allow the component to receive props from a parent component. An explicit null value indicates that the local props completely override all props received from a parent.

    style?: StyleOrFunction<ButtonRenderProps>

    The inline style for the element. A function may be provided to compute the style based on component state.

    translate?: "yes" | "no"
    type?: "button" | "submit" | "reset"

    The behavior of the button when used in an HTML form.

    'button'
    
    value?: string

    The value associated with the button's name when it's submitted with the form data.

    variant?:
        | "primary"
        | "secondary"
        | "tertiary"
        | Partial<Record<Breakpoint, "primary" | "secondary" | "tertiary">>