@thenewboston/ui
Version:
UI Library for the thenewboston community
42 lines (41 loc) • 1.4 kB
TypeScript
import React, { HTMLAttributes, ReactNode } from 'react';
import '../../../styles/colors.css';
import '../../../styles/font.css';
import './Button.scss';
export declare enum ButtonColor {
primary = "primary",
secondary = "secondary",
tertiary = "tertiary"
}
export declare enum ButtonType {
button = "button",
reset = "reset",
submit = "submit"
}
export declare enum ButtonVariant {
contained = "contained",
link = "link"
}
export interface ButtonProps extends HTMLAttributes<HTMLButtonElement> {
/** Required. The content of the button. */
children: ReactNode;
/** Optional. Extra classNames you can pass. */
className?: string;
/** Optional. Determines the color of the button. */
color?: ButtonColor;
/** Optional. Disables the button. */
disabled?: boolean;
/** Optional. Determines if button is focused. */
focused?: boolean;
/** Optional. Adds an onClick event handler to the button. */
onClick?(e: React.MouseEvent<HTMLButtonElement, MouseEvent>): void;
/** Optional. Button type. */
type?: ButtonType;
/** Optional. Determines the UI of the button. */
variant?: ButtonVariant;
}
/**
* Button component.
*/
declare const Button: ({ children, color, className, disabled, focused, onClick, type, variant, }: ButtonProps) => JSX.Element;
export { Button };