import type { Meta, StoryObj } from '@storybook/react' import { Avatar, AvatarImage, AvatarFallback } from './avatar' const meta: Meta = { title: 'Primitives/Avatar', component: Avatar, parameters: { layout: 'centered', backgrounds: { default: 'dark' } }, } export default meta type Story = StoryObj export const WithImage: Story = { render: () => ( SC ), } export const Fallback: Story = { render: () => ( JD ), } export const FallbackOnly: Story = { render: () => ( AK ), } export const CustomSize: Story = { render: () => ( BL ), } export const Overview: Story = { name: 'Overview', render: () => (
Sizes
XS SM MD LG XL
Team
{[ { initials: 'AK', label: 'Alex Kim' }, { initials: 'JD', label: 'Jane Doe' }, { initials: 'MR', label: 'Marco Rossi' }, { initials: 'SP', label: 'Sara Park' }, ].map(({ initials, label }) => (
{initials} {label}
))}
Stacked
{['AK', 'JD', 'MR', 'SP', '+4'].map((label) => ( {label} ))}
), }