@styleless-ui/react
Version:
Completely unstyled, headless and accessible React UI components.
21 lines (20 loc) • 915 B
TypeScript
import * as React from "react";
interface ButtonBaseProps<T extends HTMLElement = HTMLButtonElement> {
disabled?: boolean;
autoFocus?: boolean;
onClick?: React.MouseEventHandler<T>;
onBlur?: React.FocusEventHandler<T>;
onFocus?: React.FocusEventHandler<T>;
onKeyDown?: React.KeyboardEventHandler<T>;
onKeyUp?: React.KeyboardEventHandler<T>;
}
declare const useButtonBase: <T extends HTMLElement = HTMLButtonElement>(props: ButtonBaseProps<T>) => {
isFocusedVisible: boolean;
handleBlur: (event: React.FocusEvent<T, Element>) => void;
handleClick: (event: React.MouseEvent<T, MouseEvent>) => void;
handleFocus: (event: React.FocusEvent<T, Element>) => void;
handleKeyDown: (event: React.KeyboardEvent<T>) => void;
handleKeyUp: (event: React.KeyboardEvent<T>) => void;
handleButtonRef: (instance: T | null | undefined) => void;
};
export default useButtonBase;