AwesomeCard
Multi-purpose stat card with an SVG pattern background, collapsible body and tap-to-expand modal, built as a compound component.
Installation
pnpm dlx @kivacore/ui-cli add @kivacore/rn-awesome-cardpnpm add react-native-svg react-native-reanimatedUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Card content (sub-components) |
pattern | boolean | true | Draw the SVG pattern behind the card chrome |
patternStyle | 'stripes' | 'dots' | 'grid' | 'crosshatch' | 'zigzag' | 'stripes' | Pattern motif |
collapsible | boolean | false | Enable collapse toggle |
collapsed | boolean | false | Initial collapsed state (uncontrolled, same as web) |
chevronPosition | 'left' | 'right' | 'left' | Position of the collapse chevron |
expandable | boolean | false | Show 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 |
expandedWidth | number | string | 480 | Accepted for web parity; ignored on native |
expandedHeight | number | string | 320 | Accepted for web parity; ignored on native |
expanded | boolean | - | Controlled expanded state |
onExpandedChange | (expanded: boolean) => void | - | Called when the expanded state changes |
expandSpeed | number | 0.35 | Expand animation duration in seconds (reduced motion skips it) |
className | string | - | Additional CSS classes |
AwesomeCardHeader
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Header content (Title, Icon) |
className | string | - | Additional CSS classes |
AwesomeCardTitle
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Title text (strings are styled automatically) |
className | string | - | Additional CSS classes |
AwesomeCardIcon
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Icon element |
className | string | - | Additional CSS classes |
AwesomeCardBody
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Body content (hidden while collapsed) |
className | string | - | Additional CSS classes |
AwesomeCardExpandedBody
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Content shown only in the expanded modal (scrollable) |
className | string | - | Classes for the scroll content container |
AwesomeCardValue
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Value (strings / numbers use tabular figures) |
className | string | - | Additional CSS classes |
AwesomeCardTrend
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Trend text |
positive | boolean | - | true → emerald, false → red, omitted → muted |
className | string | - | Additional CSS classes |
Components
| Component | Description |
|---|---|
AwesomeCard | Root container (pattern, collapse and expand state) |
AwesomeCardHeader | Header row with chevron and expand button |
AwesomeCardTitle | Title text |
AwesomeCardIcon | Icon slot |
AwesomeCardBody | Collapsible body |
AwesomeCardExpandedBody | Body shown only in the expanded modal |
AwesomeCardValue | Large value text |
AwesomeCardTrend | Trend indicator |
Type Exports
| Type | Description |
|---|---|
AwesomeCardProps | Props for AwesomeCard |
AwesomeCardHeaderProps | Props for AwesomeCardHeader |
AwesomeCardTitleProps | Props for AwesomeCardTitle |
AwesomeCardIconProps | Props for AwesomeCardIcon |
AwesomeCardBodyProps | Props for AwesomeCardBody |
AwesomeCardExpandedBodyProps | Props for AwesomeCardExpandedBody |
AwesomeCardValueProps | Props for AwesomeCardValue |
AwesomeCardTrendProps | Props for AwesomeCardTrend |
ExpandDirection | 'rt' | 'rb' | 'lt' | 'lb' (web parity, ignored) |
PatternStyle | 'stripes' | 'dots' | 'grid' | 'crosshatch' | 'zigzag' |
AvatarThumbnail
Avatar display component that renders an image, an emoji or a KivaIcon on a Tailwind-coloured background with a configurable shape.
AwesomeDialog
Compound dialog rendered as a centred modal, an edge sheet or a swipe-to-dismiss drawer, with pattern chrome, header avatar / icon, toolbar menus, fullscreen and minimise-to-bar.