UNPKG

@amsterdam/design-system-react

Version:

All React components from the Amsterdam Design System. Use it to compose pages in your website or application.

35 lines (34 loc) 1.36 kB
/** * @license EUPL-1.2+ * Copyright Gemeente Amsterdam */ import type { ButtonHTMLAttributes, PropsWithChildren } from 'react'; import type { IconProps } from '../Icon'; type IconBeforeProp = { /** Shows the icon before the label. Requires a value for `icon`. Cannot be used together with `iconOnly`. */ iconBefore?: boolean; iconOnly?: never; }; type IconOnlyProp = { iconBefore?: never; /** Shows the icon without the label. Requires a value for `icon`. Cannot be used together with `iconBefore`. */ iconOnly?: boolean; }; type IconButtonProps = (IconBeforeProp | IconOnlyProp) & { /** Adds an icon to the button, showing it after the label. */ icon: IconProps['svg']; }; type TextButtonProps = { icon?: never; iconBefore?: never; iconOnly?: never; }; export type ButtonProps = (IconButtonProps | TextButtonProps) & PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & { /** The level of prominence. Use a primary button only once per page or section. */ variant?: 'primary' | 'secondary' | 'tertiary'; }; /** * @see {@link https://designsystem.amsterdam/?path=/docs/components-buttons-button--docs Button docs at Amsterdam Design System} */ export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>; export {};