@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
43 lines (42 loc) • 1.44 kB
TypeScript
/**
* @template T
* @typedef {import("preact/hooks").Ref<T>} Ref
*/
/**
* @typedef IconProps
* @prop {string|symbol} name - The name of the icon to display.
* The name must match a name that has already been registered using the
* `registerIcon` or `registerIcons` functions.
* @prop {string} [classes] - CSS classes to apply to the `<svg>` element.
* @prop {string} [containerClasses] - CSS classes to apply to wrapping element.
* @prop {string} [title] - Optional title attribute to apply to the SVG's containing `span`.
*/
/**
* Component that renders icons using inline `<svg>` elements.
*
* @deprecated - Use standalone icon components instead
*
* @param {IconProps} props
*/
export function Icon({ name, classes, containerClasses, title, }: IconProps): import("preact").JSX.Element;
export type Ref<T> = import("preact/hooks").Ref<T>;
export type IconProps = {
/**
* - The name of the icon to display.
* The name must match a name that has already been registered using the
* `registerIcon` or `registerIcons` functions.
*/
name: string | symbol;
/**
* - CSS classes to apply to the `<svg>` element.
*/
classes?: string | undefined;
/**
* - CSS classes to apply to wrapping element.
*/
containerClasses?: string | undefined;
/**
* - Optional title attribute to apply to the SVG's containing `span`.
*/
title?: string | undefined;
};