UNPKG

gadgets

Version:

Reusable React UI widgets - This is my widget library. There are many like it, but this one is mine...

50 lines (49 loc) 1.66 kB
/** * A typical button control widget. This control only uses an icon and no text * to represent the button. The icons are [Font Awesome](http://fontawesome.io/) * strings. That library is built into this module, so any font available in * the current release of that library is available. The buttons fill the size * of their parent container. * * #### Examples: * * ```javascript * import {Button} from 'gadgets'; * <Button iconName="cab" onClick={someFunction} /> * ``` * * #### Events * - `onClick()` - This callback is invoked when the control is clicked by the * user * * #### Styles * - `ui-button` - A top level style placed on `<i>` control that constructs the * button. * * #### Properties * - `iconName="bomb" {string}` - the name of the font awesome icon used with * this button * - `iconStyle="" {string}` - a CSS style class name that will be added to the * icon within the button. * - `kbActivate="" {string}` - Invokes the keyboard handler for the button for the * given sequence. * * @module Button */ import * as React from "react"; import { BaseComponent, BaseProps, BaseState } from "../shared"; export interface ButtonProps extends BaseProps { iconName?: string; iconStyle?: string; kbActivate?: string; onClick?: (e: React.MouseEvent<HTMLDivElement>) => void; } export declare type ButtonState = BaseState; export declare const BaseButtonView: any; export declare class Button extends BaseComponent<ButtonProps, ButtonState> { static readonly defaultProps: ButtonProps; constructor(props: ButtonProps); private handleClick; render(): JSX.Element; } export default Button;