import { Section } from "./section" import { H2, Text } from "./text" import "hono/jsx" import type { FC, JSX } from "hono/jsx" import { VStack, HStack } from "./stack" import { CodeExamples } from "./code" import { cn } from "./cn" export type AvatarProps = JSX.IntrinsicElements["img"] & { size?: number rounded?: boolean } export const Avatar: FC = (props) => { const { src, size = 32, rounded, class: className, style, id, ref, alt = "", ...rest } = props const avatarStyle: JSX.CSSProperties = { width: `${size}px`, height: `${size}px`, borderRadius: rounded ? "9999px" : undefined, ...(style as JSX.CSSProperties), } return {alt} } export const Test = () => { const sampleImages = [ "https://picsum.photos/seed/3/200/200", "https://picsum.photos/seed/2/200/200", "https://picsum.photos/seed/8/200/200", "https://picsum.photos/seed/9/200/200", ] return (
{/* API Usage Examples */} ', '', '', '', ]} /> {/* Size variations */}

Size Variations

{[24, 32, 48, 64, 96].map((size) => ( {size}x{size} ))}
{/* Rounded vs Square */}

Rounded vs Square

Square Rounded
{/* Different images */}

Different Images

{sampleImages.map((src, index) => ( Image {index + 1} ))}
{/* Custom styles */}

With Custom Styles

With Border With Shadow Border + Shadow
) }