Skip to main content

CardImage

The CardImage component in our library is a specialized element within a card layout designed to prominently display an image as the focal point of the card. This component is ideal for showcasing visual content such as photographs, illustrations, or graphics within a structured card format.

Usage

Basic usage

import React from 'react';
import {CardImage} from 'rn-inkpad';

import Landscape from './assets/landscape.jpeg';

const MyComponent = () => {
return <CardImage source={Landscape} />;
};

Props

NameTypeRequiredDescription
sourceImageSourcePropTypeYESImage source.
loadTimenumberNOImage loading time.
textstringNODescription text.
themeThemeNOPersonalize your card.
Information

The image starts with a blur effect and decreases as the loading time progresses.

Note

If you don't want that effect, you can submit a load time of 0 milliseconds.

Theme props

NameTypeDefaultDescription
backgroundColorstringCard background color.
fontSizenumberText information font size.
fontColorstringText information color.
fontWeightstringFont weight.
radiusnumber15Border radius.
shadowbooleanTurn shadow on or off.

Personalized theme usage

import React from 'react';
import {CardImage} from 'rn-inkpad';

import Landscape from './assets/landscape.jpeg';

const MyComponent = () => {
return (
<CardImage
source={Landscape}
text="Landscape"
loadTime={0}
theme={{
backgroundColor: '#EEEEEE',
fontSize: 16,
fontColor: '#DB504A',
fontWeight: '700',
shadow: true,
radius: 0,
}}
/>
);
};

Example with personalized theme