UNPKG

@withjoy/joykit

Version:

UI Component Library for Joy web

45 lines (44 loc) 1.56 kB
import React from 'react'; import { BundledIcon } from '../../../icons'; import { PositionProps, TopProps, RightProps } from 'styled-system'; import { BaseComponentProps } from '../../common/props'; export declare type IconSource = BundledIcon | boolean | null | undefined | React.ReactElement<any>; export interface ComposedIconProps extends PositionProps, TopProps, RightProps, BaseComponentProps { } export interface IconProps extends ComposedIconProps { /** * Descriptive text to be read to screenreaders. * If not provided, the label will default to the one provided by * the Icon - if it exists. */ a11yLabel?: string; /** * This component does not support custom children. */ /** * To be used as the fill attribute on the `<svg />`, otherwise inherit from * surrounding context. * * @example * <Button><Icon source="globe"/></Button> * If the button has `color: #FFF`, then the SVG will also be white. */ color?: string; /** * String to appear on hover. * If not provided and icon exists, will default to the icon name. * */ htmlTitle?: string; iconSize?: number; source: IconSource; /** * Whether the target SVG should be stacked on a base container */ useBackdrop?: boolean; } export declare class Icon extends React.PureComponent<IconProps & React.HTMLAttributes<any>> { static displayName: string; render(): React.ReactNode; private isBundledJoyKitIcon; }