Skip to main content

MultinaireCard

Card container with border, border radius, and optional press handling.

Basic Usage

import { MultinaireCard, MultinaireText } from '@multinaire/multinaire-design';

<MultinaireCard>
<MultinaireText>Card content</MultinaireText>
</MultinaireCard>

Props

PropTypeDefaultDescription
isLoadingbooleanfalseShow a loading skeleton in place of the card content
flexnumberFlex grow value
marginSpacingPropsOuter margin. Accepts a number for uniform margin, or an object for per-side control
paddingSpacingPropsInner padding. Accepts a number for uniform padding, or an object for per-side control
widthDimensionValueFixed width of the card
heightDimensionValueFixed height of the card
borderRadiusnumbertheme mediumCorner radius in pixels. Defaults to the theme's medium radius
styleViewStyleAdditional styles applied to the card
selectedbooleanfalseWhen true, the card border color changes to the theme's primary color
backgroundColorColorKeysBackground color key from the active theme palette
borderColorColorKeysbackgroundVariantBorder color key from the active theme palette. Overrides the default backgroundVariant border. Ignored when selected is true
badgeReactElementMultinaireBadge component rendered as an overlay on the card
onPress() => voidPress handler. When omitted the card renders as a plain View (fixes web ScrollView scroll freeze)

Examples

Basic Card

<MultinaireCard padding={16}>
<MultinaireText type="heading">Card Title</MultinaireText>
<MultinaireText color="neutral">Card description</MultinaireText>
</MultinaireCard>

Pressable Card

<MultinaireCard onPress={() => handleCardPress()}>
<MultinaireText>Tap me</MultinaireText>
</MultinaireCard>

Selected State

<MultinaireCard selected={isSelected} onPress={() => setIsSelected(!isSelected)}>
<MultinaireText>Selectable card</MultinaireText>
</MultinaireCard>

Custom Colors

<MultinaireCard backgroundColor="backgroundVariant" borderColor="primary">
<MultinaireText>Custom styled card</MultinaireText>
</MultinaireCard>

Card with Badge

<MultinaireCard
badge={<MultinaireBadge type="primary" title="New" />}
padding={16}
>
<MultinaireText>Card with badge overlay</MultinaireText>
</MultinaireCard>

Loading Card

<MultinaireCard isLoading width={200} height={100} />

Custom Sizing

<MultinaireCard
width="100%"
height={150}
margin={{ bottom: 16 }}
borderRadius={12}
>
<MultinaireText>Full width card</MultinaireText>
</MultinaireCard>

Notes

  • When onPress is not provided, the card renders as an Animated.View instead of a TouchableOpacity. This prevents the card from blocking scroll in a ScrollView on web.