2026-05-20 16:49:19 +08:00

17 lines
504 B
TypeScript

import { ButtonHTMLAttributes, ReactNode } from "react";
import clsx from "clsx";
import styles from "./IconButton.module.css";
type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
children: ReactNode;
label: string;
};
export function IconButton({ children, className, label, type = "button", ...props }: IconButtonProps) {
return (
<button aria-label={label} className={clsx(styles.root, className)} title={label} type={type} {...props}>
{children}
</button>
);
}