@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
17 lines (16 loc) • 767 B
TypeScript
import type { IconComponent, PresentationalProps } from '../../types';
import type { ButtonProps } from './Button';
type ComponentProps = {
icon?: IconComponent;
/** Required for `IconButton` as there is no text label */
title: string;
size?: 'xs' | 'sm' | 'md' | 'lg' | 'custom';
unstyled?: boolean;
variant?: 'primary' | 'secondary' | 'dark' | 'custom';
};
export type IconButtonProps = PresentationalProps & Omit<ButtonProps, 'title' | 'size' | 'variant'> & ComponentProps;
/**
* Render a button that only contains an icon.
*/
export default function IconButton({ children, classes, elementRef, pressed, expanded, icon: Icon, size, title, variant, unstyled, ...htmlAttributes }: IconButtonProps): import("preact").JSX.Element;
export {};