@navinc/base-react-components
Version:
Nav's Pattern Library
25 lines (24 loc) • 969 B
TypeScript
import { HTMLAttributes } from 'react';
import { IconName } from './icons';
import type { SizeKey } from './copy';
declare const sizeMap: {
medium: string;
large: string;
};
type Size = keyof typeof sizeMap;
type AvatarProps = {
/** Image url for the avatar */
src?: string;
/** Always provide an accessibility alt for images. Be descriptive, ie: "Jim Beam\'s profile photo" */
alt?: string;
/** Size of the avatar image/icon container */
size?: Size;
/** String value next to image. Used as a text abbreviation for the avatar if no image or icon is provided. */
label?: string;
/** Fallback icon if no image `src` or label provided */
defaultIcon?: IconName;
/** Passed as `size` prop to the `<Copy>` component */
labelSize?: SizeKey;
} & HTMLAttributes<HTMLDivElement>;
export declare const Avatar: ({ className, label, size, alt, src, defaultIcon, labelSize, ...rest }: AvatarProps) => JSX.Element;
export {};