Skip to Content
Kiva

AwesomeCard

Multi-purpose stat card with an SVG pattern background, collapsible body and tap-to-expand modal, built as a compound component.

iOSAndroid
Preview AwesomeCard on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @kivacore/ui-cli add @kivacore/rn-awesome-card
Required Packages(2 packages)
pnpm add react-native-svg react-native-reanimated

Usage

import {
  AwesomeCard,
  AwesomeCardHeader,
  AwesomeCardTitle,
  AwesomeCardIcon,
  AwesomeCardBody,
  AwesomeCardValue,
  AwesomeCardTrend,
} from '@/components/kiva-native/awesome-card';

<AwesomeCard>
  <AwesomeCardHeader>
    <AwesomeCardTitle>Revenue</AwesomeCardTitle>
    <AwesomeCardIcon>
      <KivaIcon icon="fal dollar-sign" />
    </AwesomeCardIcon>
  </AwesomeCardHeader>
  <AwesomeCardBody>
    <AwesomeCardValue>$45,231</AwesomeCardValue>
    <AwesomeCardTrend positive>+20.1% from last month</AwesomeCardTrend>
  </AwesomeCardBody>
</AwesomeCard>

Pattern

The card draws a subtle tiled pattern behind its chrome (on by default, like web). Pick one of five motifs or turn it off.

<AwesomeCard patternStyle="dots">…</AwesomeCard>
<AwesomeCard pattern={false}>…</AwesomeCard>

Collapsible

<AwesomeCard collapsible chevronPosition="right" collapsed>
  …
</AwesomeCard>

Expandable

expandable adds an expand button to the header. Tapping it presents the card in a centred modal with a scale-in animation (expandSpeed seconds). Inside the modal AwesomeCardExpandedBody replaces AwesomeCardBody; without an expanded body the regular body is shown instead. Tap the backdrop, the collapse button or the Android back button to close.

const [expanded, setExpanded] = useState(false);

<AwesomeCard expandable expanded={expanded} onExpandedChange={setExpanded}>
  <AwesomeCardHeader>
    <AwesomeCardTitle>Revenue</AwesomeCardTitle>
  </AwesomeCardHeader>
  <AwesomeCardBody>
    <AwesomeCardValue>$45,231</AwesomeCardValue>
  </AwesomeCardBody>
  <AwesomeCardExpandedBody>
    {/* monthly breakdown, charts… */}
  </AwesomeCardExpandedBody>
</AwesomeCard>

Native differences from web: expandTrigger="hover" behaves like "click" (touch has no hover), and expandDirection, expandedWidth and expandedHeight are accepted but ignored — the expanded card is a screen-sized modal rather than an in-place pointer-anchored growth. AwesomeCardExpandedBody is detected among the card's children (nested inside plain elements is fine; hidden inside your own wrapper component it is not, and both bodies would then show in the modal).

API Reference

AwesomeCard

PropTypeDefaultDescription
childrenReactNode-Card content (sub-components)
patternbooleantrueDraw the SVG pattern behind the card chrome
patternStyle'stripes' | 'dots' | 'grid' | 'crosshatch' | 'zigzag''stripes'Pattern motif
collapsiblebooleanfalseEnable collapse toggle
collapsedbooleanfalseInitial collapsed state (uncontrolled, same as web)
chevronPosition'left' | 'right''left'Position of the collapse chevron
expandablebooleanfalseShow an expand button that presents the card in a modal
expandTrigger'hover' | 'click''click'Both expand on tap on native
expandDirection'rt' | 'rb' | 'lt' | 'lb''rb'Accepted for web parity; ignored on native
expandedWidthnumber | string480Accepted for web parity; ignored on native
expandedHeightnumber | string320Accepted for web parity; ignored on native
expandedboolean-Controlled expanded state
onExpandedChange(expanded: boolean) => void-Called when the expanded state changes
expandSpeednumber0.35Expand animation duration in seconds (reduced motion skips it)
classNamestring-Additional CSS classes

AwesomeCardHeader

PropTypeDefaultDescription
childrenReactNode-Header content (Title, Icon)
classNamestring-Additional CSS classes

AwesomeCardTitle

PropTypeDefaultDescription
childrenReactNode-Title text (strings are styled automatically)
classNamestring-Additional CSS classes

AwesomeCardIcon

PropTypeDefaultDescription
childrenReactNode-Icon element
classNamestring-Additional CSS classes

AwesomeCardBody

PropTypeDefaultDescription
childrenReactNode-Body content (hidden while collapsed)
classNamestring-Additional CSS classes

AwesomeCardExpandedBody

PropTypeDefaultDescription
childrenReactNode-Content shown only in the expanded modal (scrollable)
classNamestring-Classes for the scroll content container

AwesomeCardValue

PropTypeDefaultDescription
childrenReactNode-Value (strings / numbers use tabular figures)
classNamestring-Additional CSS classes

AwesomeCardTrend

PropTypeDefaultDescription
childrenReactNode-Trend text
positiveboolean-true → emerald, false → red, omitted → muted
classNamestring-Additional CSS classes

Components

ComponentDescription
AwesomeCardRoot container (pattern, collapse and expand state)
AwesomeCardHeaderHeader row with chevron and expand button
AwesomeCardTitleTitle text
AwesomeCardIconIcon slot
AwesomeCardBodyCollapsible body
AwesomeCardExpandedBodyBody shown only in the expanded modal
AwesomeCardValueLarge value text
AwesomeCardTrendTrend indicator

Type Exports

TypeDescription
AwesomeCardPropsProps for AwesomeCard
AwesomeCardHeaderPropsProps for AwesomeCardHeader
AwesomeCardTitlePropsProps for AwesomeCardTitle
AwesomeCardIconPropsProps for AwesomeCardIcon
AwesomeCardBodyPropsProps for AwesomeCardBody
AwesomeCardExpandedBodyPropsProps for AwesomeCardExpandedBody
AwesomeCardValuePropsProps for AwesomeCardValue
AwesomeCardTrendPropsProps for AwesomeCardTrend
ExpandDirection'rt' | 'rb' | 'lt' | 'lb' (web parity, ignored)
PatternStyle'stripes' | 'dots' | 'grid' | 'crosshatch' | 'zigzag'

On this page