Open Pioneer Trails Packages
    Preparing search index...

    Properties supported by ToolButton.

    interface ToolButtonProps {
        active?: boolean;
        buttonProps?: Partial<ButtonProps>;
        disabled?: boolean;
        icon: ReactElement;
        label: string;
        loading?: boolean;
        onClick?: MouseEventHandler<HTMLButtonElement>;
        tooltipProps?: Partial<TooltipProps>;
    }

    Hierarchy

    • CommonComponentProps
    • RefAttributes<HTMLButtonElement>
      • ToolButtonProps
    Index

    Properties

    active?: boolean

    If true, indicates that the button is currently active with a different style. Defaults to undefined.

    A value of true or false indicates that the button supports being active (i.e. pressed). In that case the aria-pressed attribute will be configured automatically (see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed).

    buttonProps?: Partial<ButtonProps>

    Additional properties for the Button element.

    Note that the ToolButton also defines some of these props.

    disabled?: boolean

    If true, the button will be disabled. Defaults to false.

    icon: ReactElement

    The icon displayed by the button.

    NOTE: You can use raw icons here (e.g. svgs from react-icons). The ToolButton will surround the icon with chakra's <Icon /> component. This will apply the apply the aria-hidden attribute, among other things.

    label: string

    The label for the ToolButton. This value services as the tooltip text and the aria-label.

    This property is required for a11y reasons because a ToolButton usually only displays an icon.

    loading?: boolean

    If true, the button will show a spinner. Defaults to false.

    onClick?: MouseEventHandler<HTMLButtonElement>

    The callback that will be called when the user clicks the button.

    tooltipProps?: Partial<TooltipProps>

    Additional properties for the Tooltip element.

    Note that the ToolButton also defines some of these props.