primereact
Version:
PrimeReact is an open source UI library for React featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with Prime
119 lines (116 loc) • 3.45 kB
TypeScript
/**
*
* Button is an extension to standard button element with icons and theming.
*
* [Live Demo](https://www.primereact.org/button/)
*
* @module button
*
*/
import * as React from 'react';
import { TooltipOptions } from '../tooltip/tooltipoptions';
import { IconType } from '../utils';
/**
* Defines valid properties in Button component. In addition to these, all properties of HTMLButtonElement can be used in this component.
* @group Properties
*/
export interface ButtonProps extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'disabled' | 'ref'> {
/**
* Value of the badge.
*/
badge?: string | undefined;
/**
* Style class of the badge.
*/
badgeClassName?: string | undefined;
/**
* Used to get the child elements of the component.
* @readonly
*/
children?: React.ReactNode | undefined;
/**
* When present, it specifies that the element should be disabled.
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Name of the icon or JSX.Element for icon.
*/
icon?: IconType<ButtonProps> | undefined;
/**
* Add a textual class to the button without a background initially.
* @defaultValue false
*/
text?: boolean | undefined;
/**
* Add a circular border radius to the button.
* @defaultValue false
*/
rounded?: boolean | undefined;
/**
* Add a shadow to indicate elevation.
* @defaultValue false
*/
raised?: boolean | undefined;
/**
* Add a border class without a background initially.
* @defaultValue false
*/
outlined?: boolean | undefined;
/**
* Add a link style to the button.
* @defaultValue false
*/
link?: boolean | undefined;
/**
* Defines the style of the button, valid values are "secondary", "success", "info", "warning", "danger", "help".
*/
severity?: 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'help' | undefined;
/**
* Defines the size of the button, valid values are "small" and "large".
*/
size?: 'small' | 'large' | undefined;
/**
* Position of the icon, valid values are "left", "right", "top" and "bottom".
* @defaultValue left
*/
iconPos?: 'top' | 'bottom' | 'left' | 'right' | undefined;
/**
* Text of the button.
*/
label?: string | undefined;
/**
* Display loading icon of the button
* @defaultValue false
*/
loading?: boolean | undefined;
/**
* Name of the loading icon or JSX.Element for loading icon.
*/
loadingIcon?: IconType<ButtonProps> | undefined;
/**
* Content of the tooltip.
*/
tooltip?: string | undefined;
/**
* Configuration of the tooltip, refer to the tooltip documentation for more information.
*/
tooltipOptions?: TooltipOptions | undefined;
/**
* When present, it specifies that the element should be visible.
* @defaultValue true
*/
visible?: boolean | undefined;
}
/**
* **PrimeReact - Button**
*
* _Button is an extension to standard button element with icons and theming._
*
* [Live Demo](https://www.primereact.org/button/)
* --- ---
* 
*
* @group Component
*/
export declare class Button extends React.Component<ButtonProps, any> {}