Avatar
Generated from public Vue/TypeScript exports by
pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
Avatar
import { Avatar } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
size | "sm" | "lg" | "base" | null | undefined | "sm" | — |
shape | "circle" | "square" | null | undefined | "circle" | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
render: (args) => ({
components: { Avatar, AvatarFallback, AvatarImage },
setup() {
return { args }
},
template: `
<Avatar v-bind="args">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
`,
}),
}
WithFallback
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
name: 'With Fallback',
render: () => ({
components: { Avatar, AvatarFallback, AvatarImage },
template: `
<Avatar>
<AvatarImage src="https://invalid-url-to-trigger-fallback.example/nonexistent.png" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
`,
}),
}
Showcase
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
name: 'Showcase',
render: () => ({
components: { Avatar, AvatarFallback, AvatarImage },
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Sizes (Circle)</h3>
<div class="flex items-end gap-4">
<div class="text-center">
<Avatar size="sm">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">sm</p>
</div>
<div class="text-center">
<Avatar size="base">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">base</p>
</div>
<div class="text-center">
<Avatar size="lg">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">lg</p>
</div>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Sizes (Square)</h3>
<div class="flex items-end gap-4">
<div class="text-center">
<Avatar size="sm" shape="square">
<AvatarFallback>SM</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">sm</p>
</div>
<div class="text-center">
<Avatar size="base" shape="square">
<AvatarFallback>BS</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">base</p>
</div>
<div class="text-center">
<Avatar size="lg" shape="square">
<AvatarFallback>LG</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">lg</p>
</div>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Fallback Initials</h3>
<div class="flex items-center gap-4">
<Avatar>
<AvatarFallback>AB</AvatarFallback>
</Avatar>
<Avatar>
<AvatarFallback>CD</AvatarFallback>
</Avatar>
<Avatar>
<AvatarFallback>EF</AvatarFallback>
</Avatar>
</div>
</div>
</div>
`,
}),
}
AvatarFallback
import { AvatarFallback } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
delayMs | number | undefined | — | Useful for delaying rendering so it only appears for those with slower connections. |
asChild | boolean | undefined | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
render: (args) => ({
components: { Avatar, AvatarFallback, AvatarImage },
setup() {
return { args }
},
template: `
<Avatar v-bind="args">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
`,
}),
}
WithFallback
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
name: 'With Fallback',
render: () => ({
components: { Avatar, AvatarFallback, AvatarImage },
template: `
<Avatar>
<AvatarImage src="https://invalid-url-to-trigger-fallback.example/nonexistent.png" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
`,
}),
}
Showcase
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
name: 'Showcase',
render: () => ({
components: { Avatar, AvatarFallback, AvatarImage },
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Sizes (Circle)</h3>
<div class="flex items-end gap-4">
<div class="text-center">
<Avatar size="sm">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">sm</p>
</div>
<div class="text-center">
<Avatar size="base">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">base</p>
</div>
<div class="text-center">
<Avatar size="lg">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">lg</p>
</div>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Sizes (Square)</h3>
<div class="flex items-end gap-4">
<div class="text-center">
<Avatar size="sm" shape="square">
<AvatarFallback>SM</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">sm</p>
</div>
<div class="text-center">
<Avatar size="base" shape="square">
<AvatarFallback>BS</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">base</p>
</div>
<div class="text-center">
<Avatar size="lg" shape="square">
<AvatarFallback>LG</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">lg</p>
</div>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Fallback Initials</h3>
<div class="flex items-center gap-4">
<Avatar>
<AvatarFallback>AB</AvatarFallback>
</Avatar>
<Avatar>
<AvatarFallback>CD</AvatarFallback>
</Avatar>
<Avatar>
<AvatarFallback>EF</AvatarFallback>
</Avatar>
</div>
</div>
</div>
`,
}),
}
AvatarImage
import { AvatarImage } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
src | string | Required | — |
referrerPolicy | HTMLAttributeReferrerPolicy | undefined | — | — |
crossOrigin | "" | "anonymous" | "use-credentials" | undefined | — | — |
asChild | boolean | undefined | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
render: (args) => ({
components: { Avatar, AvatarFallback, AvatarImage },
setup() {
return { args }
},
template: `
<Avatar v-bind="args">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
`,
}),
}
WithFallback
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
name: 'With Fallback',
render: () => ({
components: { Avatar, AvatarFallback, AvatarImage },
template: `
<Avatar>
<AvatarImage src="https://invalid-url-to-trigger-fallback.example/nonexistent.png" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
`,
}),
}
Showcase
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Avatar, AvatarFallback, AvatarImage } from '.'
const defaultArgs = {
size: 'sm',
shape: 'circle',
}
{
name: 'Showcase',
render: () => ({
components: { Avatar, AvatarFallback, AvatarImage },
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Sizes (Circle)</h3>
<div class="flex items-end gap-4">
<div class="text-center">
<Avatar size="sm">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">sm</p>
</div>
<div class="text-center">
<Avatar size="base">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">base</p>
</div>
<div class="text-center">
<Avatar size="lg">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">lg</p>
</div>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Sizes (Square)</h3>
<div class="flex items-end gap-4">
<div class="text-center">
<Avatar size="sm" shape="square">
<AvatarFallback>SM</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">sm</p>
</div>
<div class="text-center">
<Avatar size="base" shape="square">
<AvatarFallback>BS</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">base</p>
</div>
<div class="text-center">
<Avatar size="lg" shape="square">
<AvatarFallback>LG</AvatarFallback>
</Avatar>
<p class="text-xs text-muted-foreground mt-2">lg</p>
</div>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-foreground">Fallback Initials</h3>
<div class="flex items-center gap-4">
<Avatar>
<AvatarFallback>AB</AvatarFallback>
</Avatar>
<Avatar>
<AvatarFallback>CD</AvatarFallback>
</Avatar>
<Avatar>
<AvatarFallback>EF</AvatarFallback>
</Avatar>
</div>
</div>
</div>
`,
}),
}