Image Component & Interactions Showcase
A flexible image component with borders, corner radii, hover animations, and configuration inheritance.
Configuration cascade in effect:
- Site default (
config/config.php):components.image.borderRadius = 'var(--radius-md)'. - Page default (
config/page_level/showcase-images.config.php):components.image.hoverScale = 1.04andcomponents.image.hoverTranslateY = '-4px'. - Instance overrides: Every prop can be selectively overridden per image instance.
All hover interactions also trigger on :focus-visible / :focus-within for keyboard accessibility, and respect prefers-reduced-motion.
1. Inheriting Page-Level Defaults
These images define only src and alt. They automatically inherit the page default radius (var(--radius-md)), hover scale (1.04), and lift (-4px).
Inherited: Radius md + hover scale 1.04 + translateY -4px
Inherited: Radius md + hover scale 1.04 + translateY -4px
2. Borders & Corner Radii
Explore token-based radii (none, sm, md, lg, full, circle) alongside solid and dashed borders.
borderRadius => 'none'
borderRadius => 'sm' + subtle border
borderRadius => 'lg' + primary border
borderRadius => 'circle' + dashed accent
3. Hover & Focus Interactions
Hover over or focus each item below to experience distinct interaction feedback.
Elevation Lift: hoverTranslateY => '-8px' + hoverShadow => 'xl'
Scale Zoom: hoverScale => 1.1
Soft Opacity: hoverOpacity => 0.75
Border & Outline: hoverBorderColor + hoverOutline
Inner Zoom (Clipped): zoomInner => true + hoverScale => 1.18
Playful Tilt: hoverRotate => '3deg' + hoverTranslateY => '-6px'
4. Aspect Ratios & Object Fit
Preset responsive ratios ensure clean alignment without layout shifts.
aspectRatio => '16/9' (Widescreen)
aspectRatio => '4/3' (Standard)
aspectRatio => '1/1' (Square)
aspectRatio => '21/9' (Cinematic banner)