import type { Meta, StoryObj } from '@storybook/react-vite'; import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount } from './avatar'; const meta = { title: 'Components/Avatar', component: Avatar, parameters: { layout: 'centered', docs: { description: { component: 'User or entity image with a text fallback. The fallback appears only once the image fails or is still loading, so initials never flash over a photo that loaded fine.', }, }, }, tags: ['autodocs'], argTypes: { size: { control: 'inline-radio', options: ['sm', 'md', 'lg'] } }, } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => ( JS ), }; export const Sizes: Story = { render: () => (
SM MD LG
), }; /** A presence dot pinned to the corner. It scales with the avatar size. */ export const WithBadge: Story = { render: () => ( JS ), }; export const Group: Story = { render: () => ( {['AB', 'CD', 'EF'].map((initials) => ( {initials} ))} +7 ), };