UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

32 lines (31 loc) 1.62 kB
import React from "react"; import { StyledButtonToggleProps } from "./button-toggle.style"; import { TagProps } from "../../__internal__/utils/helpers/tags"; export interface ButtonToggleProps extends Partial<StyledButtonToggleProps>, TagProps { /** Prop to specify the aria-label of the component */ "aria-label"?: string; /** Prop to specify the aria-labelledby property of the component */ "aria-labelledby"?: string; /** Text to display for the button. */ children?: React.ReactNode; /** Callback triggered by blur event on the button. */ onBlur?: (ev: React.FocusEvent<HTMLButtonElement>) => void; /** Callback triggered by focus event on the button. */ onFocus?: (ev: React.FocusEvent<HTMLButtonElement>) => void; /** Callback triggered by click event on the button. */ onClick?: (ev: React.MouseEvent<HTMLButtonElement>) => void; /** * Set the pressed state of the toggle button * @deprecated * */ pressed?: boolean; /** An optional string by which to identify the button in either an onClick handler, or an onChange handler on the parent ButtonToggleGroup. */ value?: string; /** @private @internal @ignore */ "data-component"?: string; } export declare const ButtonToggle: { ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, buttonIcon, buttonIconSize, children, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, disabled, onBlur, onFocus, onClick, pressed, size, value, }: ButtonToggleProps): React.JSX.Element; displayName: string; }; export default ButtonToggle;