UNPKG

@amsterdam/design-system-react

Version:

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

12 lines (11 loc) 702 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /** * @license EUPL-1.2+ * Copyright Gemeente Amsterdam */ import { CloseIcon } from '@amsterdam/design-system-react-icons'; import clsx from 'clsx'; import { forwardRef } from 'react'; import { Icon } from '../Icon'; export const IconButton = forwardRef(({ className, color, label, size, svg = CloseIcon, ...restProps }, ref) => (_jsxs("button", { ...restProps, className: clsx('ams-icon-button', color && `ams-icon-button--${color}`, className), ref: ref, children: [_jsx("span", { className: "ams-visually-hidden", children: label }), _jsx(Icon, { size: size, square: true, svg: svg })] }))); IconButton.displayName = 'IconButton';