import { Section } from "./section" import { H2, H3, H4, H5, Text, SmallText } from "./text" import "hono/jsx" import type { FC, JSX } from "hono/jsx" import { VStack, HStack } from "./stack" import { Grid } from "./grid" export type ImageProps = { src: string alt?: string width?: number height?: number objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down" style?: JSX.CSSProperties } export const Image: FC = ({ src, alt = "", width, height, objectFit, style }) => { const imageStyle: JSX.CSSProperties = { width: width ? `${width}px` : undefined, height: height ? `${height}px` : undefined, objectFit: objectFit, ...style, } return {alt} } export const Test = () => { const sampleImages = [ "https://picsum.photos/seed/1/400/600", // Portrait "https://picsum.photos/seed/2/600/400", // Landscape "https://picsum.photos/seed/3/300/300", // Square "https://picsum.photos/seed/4/200/100", // Small image ] return (
{/* API Usage Examples */}
<Image src="/photo.jpg" />
<Image src="/photo.jpg" width={200} height={200} />
<Image src="/photo.jpg" objectFit="cover" />
<Image src="/photo.jpg" style={{ borderRadius: "8px" }} />

Image Examples

{/* Size variations */}

Size Variations

64x64 64x64 96x96 96x96 128x128 128x128 192x128 192x128
{/* Object fit variations */}

Object Fit Variations

Same image with different object-fit values Object cover object-fit: cover Object contain object-fit: contain Object fill object-fit: fill Object scale-down object-fit: scale-down Object none object-fit: none
{/* Styling examples */}

Styling Examples

Rounded with border Rounded + Border With shadow With Shadow Circular with effects Circular + Effects
{/* Common use cases */}

Common Use Cases

{/* Avatar */}

Avatar

Avatar
{/* Card image */}

Card Image

Card image
Card Title
Card description goes here
{/* Gallery grid */}

Gallery Grid

{sampleImages.map((src, i) => ( {`Gallery ))}
) }