Documentation Index
Fetch the complete documentation index at: https://docs.lyzn.ai/llms.txt
Use this file to discover all available pages before exploring further.
Image
The Image component displays external images with support for sizing presets, border radius, shadows, opacity, and aspect ratio control.
Props
| Prop | Type | Default | Description |
|---|
src | string | Required | Source URL of the image |
alt | string | - | Alternative text for accessibility |
size | string | number | - | Size preset: xs, sm, md, lg, xl, or pixel value |
width | string | number | - | Specific width |
height | string | number | - | Specific height |
radius | string | number | "md" | Border radius: none, sm, md, lg, xl, full, or number |
fit | string | "cover" | Object fit mode: cover, contain, fill |
background | string | - | Background color while loading |
flush | boolean | false | Removes border radius (useful in cards) |
borderWidth | number | - | Border width in pixels |
borderColor | string | - | Border color |
shadow | string | "none" | Shadow depth: none, sm, md, lg |
opacity | number | 1 | Opacity (0-1) |
aspectRatio | number | - | Aspect ratio (e.g., 16/9, 1, 4/3) |
Size Presets
"xs" - 32px
"sm" - 48px
"md" - 64px
"lg" - 96px
"xl" - 128px
Examples
Basic Image
<Image src="https://example.com/photo.jpg" alt="Description" />
With Size Preset
<Image src="https://example.com/photo.jpg" size="lg" />
Avatar (Circular)
<Image
src="https://example.com/avatar.jpg"
size="md"
radius="full"
/>
Card Banner
<Image
src="https://example.com/banner.jpg"
height={200}
width="100%"
flush
/>
With Shadow
<Image
src="https://example.com/photo.jpg"
size="xl"
shadow="md"
radius="lg"
/>
With Border
<Image
src="https://example.com/photo.jpg"
size="lg"
borderWidth={2}
borderColor="#8B5CF6"
radius="lg"
/>
Aspect Ratio
{/* 16:9 aspect ratio */}
<Image
src="https://example.com/video-thumb.jpg"
width="100%"
aspectRatio={16/9}
/>
{/* Square */}
<Image
src="https://example.com/photo.jpg"
width="100%"
aspectRatio={1}
/>
Opacity Overlay Effect
<Image
src="https://example.com/background.jpg"
width="100%"
height={200}
opacity={0.5}
/>
Contain vs Cover
<Row gap="md">
{/* Cover (default) - fills container, may crop */}
<Image src="..." size="lg" fit="cover" />
{/* Contain - shows full image, may letterbox */}
<Image src="..." size="lg" fit="contain" />
</Row>
Common Patterns
User Profile Card
<Card>
<Row gap="md" align="center">
<Image
src={user.avatar}
size="lg"
radius="full"
/>
<Col gap="xs">
<Title value={user.name} size="sm" />
<Text value={user.email} color="muted" size="sm" />
</Col>
</Row>
</Card>
Product Card
<Card padding="none">
<Image
src={product.image}
width="100%"
aspectRatio={4/3}
flush
/>
<Col padding="md" gap="xs">
<Title value={product.name} size="sm" />
<Text value={`$${product.price}`} weight="bold" />
</Col>
</Card>
Gallery Grid
<Row gap="sm" wrap>
{images.map(img => (
<Image
key={img.id}
src={img.url}
size="lg"
radius="md"
/>
))}
</Row>
Hero Banner
<Box width="100%">
<Image
src="https://example.com/hero.jpg"
width="100%"
height={300}
radius="lg"
shadow="lg"
/>
</Box>
Thumbnail with Hover Effect
<Image
src="https://example.com/thumbnail.jpg"
size="md"
radius="md"
shadow="sm"
borderWidth={1}
borderColor="rgba(0,0,0,0.1)"
/>