Skip to main content

Image and Lighting

frontImageSource accepts the same value shape as React Native Image source.

<AnimatedCard
frontImageSource={require('./assets/card.png')}
imageFit={ImageFit.Cover}
lightingType={LightingType.Prismatic}
showTexture
/>

Image Fit

ValueBehavior
ImageFit.CoverFills the card area.
ImageFit.ContainFits the full image inside the card.
ImageFit.FillStretches the image to the card size.
ImageFit.NoneCenters the source image.
ImageFit.FitHeight, ImageFit.FitWidth, ImageFit.ScaleDownFall back to contain for React Native images.

Lighting Types

ValueLook
LightingType.NormalBasic highlight
LightingType.PrismaticRainbow prism band
LightingType.AuroraGreen and blue aurora band
LightingType.ReverseSoft reversed color band
LightingType.CosmosViolet cosmic glow
LightingType.EtchedMetallic etched lines

Use LIGHTING_TYPES and LIGHTING_LABELS to build control UI.

import { LIGHTING_LABELS, LIGHTING_TYPES } from '@0610studio/expo-holographic-card';

LIGHTING_TYPES.map((type) => ({
value: type,
label: LIGHTING_LABELS[type],
}));