UNPKG

@asphalt-react/toggle-button

Version:

ToggleButton

87 lines (83 loc) 2.02 kB
type Override<T, U> = Omit<U, keyof T> & T interface ToggleButtonProps { /** * React node for caption */ children: React.ReactNode /** * Renders a seamless variant */ seamless?: boolean /** * Sets the state of button */ on?: boolean /** * Sets the size of button. Possible values are `"xs", "s", "m", "l"` for extra small, small, medium & large respectively */ size?: "xs" | "s" | "m" | "l" /** * Renders a link ToggleButton */ link?: boolean /** * Link element to render. Accepts an HTML element or a React component. */ as?: React.ElementType /** * Accepts props & attributes for the link element. */ asProps?: object /** * Renders an Icon ToggleButton. */ icon?: boolean /** * Renders a ToggleButton with less spacing around. */ compact?: boolean /** * Emphasizes the icon instead of background by coloring it. * Works only for Compact Icon ToggleButton */ emphasize?: boolean /** * Qualifiers are icons that enhance the caption. ToggleButton prepends the qualifier by default * * Accepts SVG or SVG wrapped React component. Checkout `@asphalt-react/iconpack` for SVG wrapped React components. * * > ⚠️ Do not use `qualifier` to render an Icon ToggleButton, use `icon` prop instead */ qualifier?: React.ReactElement /** * Appends qualifier to the caption */ qualifierEnd?: boolean /** * Adapts to let other buttons stick to its start */ stickStart?: boolean /** * Adapts to let other buttons stick to its end */ stickEnd?: boolean /** * Enhances the style of the supporting button. */ stick?: boolean /** * Adds underline in link ToggleButton */ underline?: boolean /** * Applies brand intent when ToggleButton is on. */ brand?: boolean } declare function ToggleButton( props: Override< ToggleButtonProps, React.ButtonHTMLAttributes<HTMLButtonElement> > ): JSX.Element export { ToggleButton, type ToggleButtonProps };