apphouse
Version:
Component library for React that uses observable state management and theme-able components.
51 lines (50 loc) • 1.4 kB
TypeScript
import { CSSProperties } from 'glamor';
import { ButtonHTMLAttributes } from 'react';
import { StyleOverwrites } from './component.interfaces';
import { BoxSizeStyles, ButtonStyleVariant } from '../styles/defaults/themes.interface';
import React from 'react';
export type ButtonStyles = CSSProperties;
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, StyleOverwrites<ButtonStyles> {
/**
* The variant of the styles button
*/
variant?: keyof ButtonStyleVariant;
/**
* The size of the button
* @default 'm'
*/
size?: keyof BoxSizeStyles;
/**
* The content of the button
*/
children?: React.ReactNode;
/**
* If true, the button will be disabled and it will display a spinner
* @default false
* @optional
*/
loading?: boolean;
/**
* If set, the button will be rendered as an anchor tag
* an there will be limitations on the props that can be passed
*/
href?: string;
/**
* The size of the spinner
*/
loadingSize?: number;
'data-xray'?: string;
'data-style'?: string;
}
/**
* The Button Component.
*
* Usage:
*
* `npm install apphouse`
*
* Then import the component:
*
* `import { Button } from 'apphouse'`
*/
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;