@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
37 lines (36 loc) • 1.47 kB
TypeScript
/**
* @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 = {
/** Adds an icon to the button, showing it after the label. */
icon: IconProps['svg'];
} & (IconBeforeProp | IconOnlyProp);
type TextButtonProps = {
icon?: never;
iconBefore?: never;
iconOnly?: never;
};
export declare const buttonVariants: readonly ["primary", "secondary", "tertiary"];
type ButtonVariant = (typeof buttonVariants)[number];
export type ButtonProps = {
/** The level of prominence. Use a primary button only once per page or section. */
variant?: ButtonVariant;
} & PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & (IconButtonProps | TextButtonProps);
/**
* @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 {};