@coconut-software/ui
Version:
React components for faster and easier web development.
37 lines (36 loc) • 1.48 kB
TypeScript
import React from 'react';
import type { AriaAttributes, KeyboardEventHandler, HTMLAttributeAnchorTarget, MouseEventHandler, ReactNode } from 'react';
import type SvgIcon from '../SvgIcon/SvgIcon';
export interface ButtonProps {
'aria-controls'?: AriaAttributes['aria-controls'];
'aria-expanded'?: AriaAttributes['aria-expanded'];
'aria-haspopup'?: AriaAttributes['aria-haspopup'];
children?: ReactNode & {
type?: {
uiName?: string;
};
};
color?: ButtonColor;
dataSet?: Record<string, string | undefined>;
disabled?: boolean;
endAdornment?: typeof SvgIcon;
form?: string;
href?: string;
id?: string;
onClick?: MouseEventHandler<HTMLElement>;
onKeyDown?: KeyboardEventHandler<HTMLElement>;
position?: ButtonPosition | null;
size?: ButtonSize;
startAdornment?: typeof SvgIcon;
tabIndex?: number;
target?: HTMLAttributeAnchorTarget;
type?: ButtonType;
variant?: ButtonVariant;
}
export type ButtonColor = 'danger' | 'default' | 'inverse' | 'primary' | 'secondary';
type ButtonPosition = 'left' | 'middle' | 'right';
export type ButtonSize = 'large' | 'medium' | 'small';
type ButtonType = 'button' | 'reset' | 'submit';
export type ButtonVariant = 'contained' | 'outlined' | 'text';
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
export default Button;