Skip to content

Image

Overview

Extrude Image transforms regular images into interactive 3D elements with customizable depth, frames, animations, and effects.

Usage

import { ExtrudeImage } from 'extrude-ui';
function MyComponent() {
return (
<ExtrudeImage
src="/path/to/image.jpg"
alt="Description"
animation="float"
scale={2}
wobble={true}
wobbleSpeed={1}
wobbleStrength={1}
/>
);
}

Props

Core Props

PropTypeDefaultDescription
srcstringURL of the image
altstringAlternative text for accessibility
onClick() => voidFunction called when image is clicked

Sizing and Positioning

PropTypeDefaultDescription
widthnumberWidth of the image
heightnumberHeight of the image
scalenumber1Scale factor of the image

3D Effects

PropTypeDefaultDescription
depthnumber10Depth of the 3D effect
floatIntensitynumber1Intensity of floating animation
floatSpeednumber1Speed of floating animation

Material Properties

PropTypeDefaultDescription
opacitynumber1Opacity of the image
transparentbooleanfalseEnable transparency

Frame Properties

PropTypeDefaultDescription
framebooleanfalseEnable frame around image
frameColorstring"#000000"Color of the frame
frameWidthnumber10Width of the frame
frameStyle'metal' | 'glass' | 'matte' | 'glossy'"metal"Style of the frame

Animation and Interaction

PropTypeDefaultDescription
animation'float' | 'none'"none"Type of animation
wobblebooleanfalseEnable wobble effect
wobbleSpeednumber1Speed of wobble animation
wobbleStrengthnumber1Intensity of wobble effect

Shadow Properties

PropTypeDefaultDescription
shadowColorstring"#000000"Color of the shadow
shadowOpacitynumber0.2Opacity of the shadow (0-1)

Loading State

PropTypeDefaultDescription
fallbackReact.ReactNodeCustom loading component
loadingAnimation'spinner' | 'pulse' | 'dots'"spinner"Type of loading animation
loadingColorstringColor of the loading indicator

Example:

Framed Image

<ExtrudeImage
width={150}
height={100}
src="path/to/image.png"
alt="Landscape photo"
frame={true}
frameStyle="matte"
frameWidth={3}
animation="float"
floatIntensity={100}
floatSpeed={2}
scale={.01}
frameColor="#a1953a"
/>