@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
34 lines • 1.68 kB
TypeScript
/** @packageDocumentation
* @module Icon
*/
import "./IconComponent.scss";
import * as React from "react";
import { ConditionalStringValue } from "@itwin/appui-abstract";
import type { CommonProps } from "../utils/Props.js";
import { ConditionalIconItem } from "./ConditionalIconItem.js";
/** Prototype for an IconSpec which can be a string, ReactNode or ConditionalStringValue.
* Strings are expected to be one of the following:
* - Created by `IconSpecUtilities.createWebComponentIconSpec` in appui-abstract (deprecated).
* - A URL to a SVG file (must end with ".svg").
* - A dataURI with MimeTypes `image/svg+xml` (ensure valid dataURI encoding) or `image/svg+xml;base64`;
* - Anything else will be treated as a class name and be directly added to the `class` attribute.
* @public
* @deprecated in 4.16.0. Use `React.ReactNode` instead.
*/
export type IconSpec = string | ConditionalStringValue | React.ReactNode | ConditionalIconItem;
/** Properties for the [[Icon]] React component
* @public
* @deprecated in 4.16.0. Props of deprecated {@link Icon} component.
*/
export interface IconProps extends CommonProps {
/** CSS class name or SvgPath for icon. This is optional because it is improperly
* used to extend other interfaces and changing it would break existing API.
*/
iconSpec?: IconSpec;
}
/** Icon Functional component displays an icon based on an [[IconSpec]].
* @public
* @deprecated in 4.16.0. Used to render a deprecated {@link IconSpec} type. Use {@link https://itwinui.bentley.com/ iTwinUI Icon} instead.
*/
export declare function Icon(props: IconProps): React.JSX.Element | null;
//# sourceMappingURL=IconComponent.d.ts.map