import type Mithril from 'mithril'; import Component, { ComponentAttrs } from '../Component'; export interface IButtonAttrs extends ComponentAttrs { /** * Class(es) of an optional icon to be rendered within the button. * * If provided, the button will gain a `has-icon` class. */ icon?: string; /** * Disables button from user input. * * Default: `false` */ disabled?: boolean; /** * Show a loading spinner within the button. * * If `true`, also disables the button. * * Default: `false` */ loading?: boolean; /** * **DEPRECATED:** Please use the `aria-label` attribute instead. For tooltips, use * the `` component. * * Accessible text for the button. This should always be present if the button only * contains an icon. * * The textual content of this attribute is passed to the DOM element as `aria-label`. * * @deprecated */ title?: string | Mithril.ChildArray; /** * Accessible text for the button. This should always be present if the button only * contains an icon. * * The textual content of this attribute is passed to the DOM element as `aria-label`. */ 'aria-label'?: string | Mithril.ChildArray; /** * Button type. * * Default: `"button"` * * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type */ type?: string; } /** * The `Button` component defines an element which, when clicked, performs an * action. * * Other attrs will be assigned as attributes on the `