@spicy-ui/core
Version:
A themable and extensible React UI library, ready to use out of the box
23 lines (22 loc) • 1.08 kB
TypeScript
import * as React from 'react';
import { SxProp } from '../../system';
import { ChildrenProp, HTMLAttributes, LiteralUnion } from '../../types';
export declare type AvatarSizes = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
export declare type AvatarVariants = 'circle' | 'rounded' | 'square';
export interface AvatarProps extends HTMLAttributes, ChildrenProp, SxProp {
/** Function to overwrite getting avatar initials. */
getInitials?: (name: string) => string;
/** The avatars fallback icon when the src is not loaded or specified. */
icon?: React.ReactElement;
/** Name of the person the avatar represents. */
name?: string;
/** If `true` the Avatar will show a border around it. */
showBorder?: boolean;
/** Image url of the Avatar. */
src?: string;
/** Size of the avatar. */
size?: LiteralUnion<AvatarSizes>;
/** Variant of the avatar. */
variant?: LiteralUnion<AvatarVariants>;
}
export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;