Askr documentation
Generated API snapshot

@askrjs/ui/avatar

Exports from the declarations published in @askrjs/ui. Signatures reflect the published artifact.

Exports

This entrypoint publishes 14 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.

Avatartype

Avatar: { (props: AvatarProps): JSX.Element; (props: AvatarAsChildProps): JSX.Element; }

Renders the `avatar` part of `avatar`. Supports polymorphic rendering via `asChild`.

AVATAR_A11Y_CONTRACTtype

AVATAR_A11Y_CONTRACT: { readonly ROOT: { readonly slot: "data-slot"; readonly marker: "data-avatar"; }; readonly IMAGE: { readonly slot: "data-slot"; readonly marker: "data-avatar-image"; readonly requiresAlt: true; }; readonly FALLBACK: { readonly slot: "data-slot"; readonly marker: "data-avatar-fallback"; readonly visibleBeforeImageLoad: true; }; }

Accessibility contract for Avatar primitives.

AvatarA11yContracttype

AvatarA11yContract: typeof AVATAR_A11Y_CONTRACT

Type of the Avatar A11y Contract object.

AvatarAsChildPropstype

AvatarAsChildProps: BoxAsChildProps & AvatarOwnProps

Props for the `asChild` (polymorphic) rendering of Avatar.

asChild
asChild: true;
children
children: JSXElement;
id
id?: string | undefined;
ref
ref?: Ref<Element>;

AvatarFallbacktype

AvatarFallback: { (props: AvatarFallbackProps): JSX.Element | null; (props: AvatarFallbackAsChildProps): JSX.Element | null; }

Renders the `avatar-fallback` part of `avatar`. Supports polymorphic rendering via `asChild`.

AvatarFallbackAsChildPropstype

AvatarFallbackAsChildProps: BoxAsChildProps & AvatarFallbackOwnProps

Props for the `asChild` (polymorphic) rendering of Avatar Fallback.

asChild
asChild: true;
children
children: JSXElement;
ref
ref?: Ref<Element>;

AvatarFallbackOwnPropstype

AvatarFallbackOwnProps: {
  children?: unknown;
}

Own props for Avatar Fallback, before merging with native element attributes.

children
children?: unknown;

AvatarFallbackPropstype

AvatarFallbackProps: BoxProps<'span', HTMLSpanElement> & AvatarFallbackOwnProps

Props for Avatar Fallback.

asChild
asChild?: false | undefined;
children
children?: unknown;
ref
ref?: Ref<HTMLSpanElement>;

AvatarImagetype

AvatarImage: (props: AvatarImageProps) => JSX.Element

Renders the `avatar-image` part of `avatar`.

AvatarImageOwnPropstype

AvatarImageOwnProps: {
  src?: string;
  alt: string;
  onLoadingStatusChange?: (status: AvatarLoadingStatus) => void;
}

Own props for Avatar Image, before merging with native element attributes.

alt
alt: string;
onLoadingStatusChange
onLoadingStatusChange?: ((status: AvatarLoadingStatus) => void) | undefined;
src
src?: string | undefined;

AvatarImagePropstype

AvatarImageProps: Omit<JSX.IntrinsicElements['img'], 'children' | 'ref' | 'onLoad' | 'onError' | 'alt' | 'src'> & AvatarImageOwnProps & {
  ref?: Ref<HTMLImageElement>;
}

Props for Avatar Image.

alt
alt: string;
onLoadingStatusChange
onLoadingStatusChange?: ((status: AvatarLoadingStatus) => void) | undefined;
ref
ref?: Ref<HTMLImageElement>;
src
src?: string | undefined;

AvatarLoadingStatustype

AvatarLoadingStatus: 'idle' | 'loading' | 'loaded' | 'error'

Avatar Loading Status.

AvatarOwnPropstype

AvatarOwnProps: {
  children?: unknown;
  id?: string;
}

Own props for Avatar, before merging with native element attributes.

children
children?: unknown;
id
id?: string | undefined;

AvatarPropstype

AvatarProps: BoxProps<'span', HTMLSpanElement> & AvatarOwnProps

Props for Avatar.

asChild
asChild?: false | undefined;
children
children?: unknown;
id
id?: string | undefined;
ref
ref?: Ref<HTMLSpanElement>;