Avatar
Server ComponentUser image with a fallback.
Import
tsx
import { Avatar } from "@cronus-ui/ui";
bash
npx cronus-ui add avatar
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
fallback.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component AvatarFallback layout:inline style:avatar {
label "AL"
}
page "/audit/avatar/fallback" type:custom {
use AvatarFallback
}
API Reference
Generated from the component's exported types.
AvatarProps
Extends ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
AvatarImageProps
Extends ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | — | — |
alt | string | — | — |
asChild | boolean | — | Render as the child element via Slot. |
AvatarFallbackProps
Extends ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
| Prop | Type | Default | Description |
|---|---|---|---|
delayMs | number | — | Delay before showing the fallback. |
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |