UNPKG

@blueprintjs/core

Version:

Core styles & components

46 lines (45 loc) • 2.28 kB
import { type DefaultSVGIconProps, type IconNextName, type NextIconVariant, type SVGIconProps } from "@blueprintjs/icons/next"; import { type IntentProps, type MaybeElement, type Props } from "../../common"; export interface IconNextOwnProps { /** * Whether the component should automatically load icon contents using an async import. * * @default true */ autoLoad?: boolean; /** * Name of a next-generation Blueprint UI icon, or an icon element, to render. * * - If `null` or `undefined` or `false`, this component will render nothing. * - If given a `IconNextName` string, that icon will be rendered as an `<svg>` with `<path>` tags. * - If given a `React.JSX.Element`, that element is cloned with the parent-provided `className` and intent class * merged onto its root. If the element is a Blueprint icon component, DOM attributes and the `color` and * `size` props are also forwarded onto it, with the element's own `color`/`size` taking precedence. For any * other element type, other props on this component are ignored. */ icon: IconNextName | MaybeElement; /** * Icon variant. Next icons support outlined (default) and filled variants. * If `"filled"` is requested but unavailable for this icon, falls back to `"outlined"`. * * @default "outlined" */ variant?: NextIconVariant; } export type IconNextProps<T extends Element = Element> = IntentProps & Props & SVGIconProps<T> & IconNextOwnProps; /** * The default `<IconNext>` props interface, equivalent to `IconNextProps` with its default type parameter. * This is primarily exported for documentation purposes; users should reference `IconNextProps<T>` instead. */ export interface DefaultIconNextProps extends IntentProps, Props, DefaultSVGIconProps, IconNextOwnProps { } export interface IconNextComponent extends React.FC<IconNextProps<Element>> { <T extends Element = Element>(props: IconNextProps<T>): React.ReactNode; } /** * Next-generation icon component. Renders icons from `@blueprintjs/icons/next` with * dynamic loading support and outlined/filled variant switching. * * @see https://blueprintjs.com/docs/#core/components/icon */ export declare const IconNext: IconNextComponent;