SwipeUI

Info card

A topic, its description, a chip and a chevron on a deep, softly curved surface, in large, medium and small sizes.

npx @swipeui/cli add info-card
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • A list of topics people open for more, such as plans, guides, settings groups or catalogue entries, each with a short description.
  • Marking one topic with a status or tier, such as Free, New or Beta, in the top-end chip.
  • A two-column grid of tappable tiles on a home or explore screen (medium).
  • A dense stack of short entries where each still deserves a card, such as recent documents (small).

When not to use it

  • Long lists of similar rows, such as settings or contacts. List row is lighter and easier to scan.
  • Content that opens in place. Expandable card grows into a full-width panel instead of navigating.
  • A number that matters more than the words. Metric card puts the value first.
  • Image-led content. Cover card, Minimal listing card and Product spotlight card lead with the photo.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add info-card
  • Adds components/swipeui/card/info-card.tsx and 6 shared helpers.
  • Installs class-variance-authority, react-native-svg, uniwind, react-native-reanimated, react-native-worklets, clsx, tailwind-merge, expo-haptics. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/library.tsx
import { InfoCard } from '@/components/swipeui/card/info-card';

<InfoCard
  title="Card"
  description="A token-based surface with media, header, body and footer slots."
  chip="Free"
  onPress={() => router.push('/components/card')}
/>;

Examples

app/home.tsx
import { InfoCard } from '@/components/swipeui/card/info-card';

<View className="flex-row gap-3">
  <InfoCard size="medium" title="Daily plan" description="Three focus blocks." chip="New" onPress={openPlan} className="flex-1" />
  <InfoCard size="medium" title="Weekly review" description="What moved, what stalled." onPress={openReview} className="flex-1" />
</View>;

Glass appearance

In the preview, choose Glass in the Preset picker. Pass the Pro Glass material into surfaceBackground to style the card fill.

API reference

InfoCardProps

PropTypeDefaultDescription
titlestring—

The topic, shown first and read first.

description?string—

Supporting text under the title. Large shows three lines, medium two and small one.

chip?ReactNodeundefined

A chip: top end in large, beside the chevron in medium, before it in small. A string renders a soft pill; pass any node (a Badge, a price, a status dot) for full control.

leading?ReactNodeundefined

Leading icon or artwork: above the title in medium, at the start in small and large.

size?InfoCardSize'large'

Layout. large is a long, full-width row; medium a tile for two-column grids; small a compact row.

surface?InfoCardSurface'raised'

Surface treatment. raised adds the deeper layered shadow and a hairline.

surfaceBackground?objectundefined

Decorative replacement for the card fill. It receives the card’s bounds.

chevron?booleantrue when `onPress` is set

Show the trailing chevron that says the card opens more.

disabled?booleanfalse

Prevent activation and dim the card.

haptics?booleantrue

Impact feedback when pressed.

motion?MotionOverridethe app's feel

Press character.

onPress?((event: GestureResponderEvent) => void)—

Opens the detail. Without it the card is a static surface.

accessibilityLabel?stringthe title, description and a string chip, joined

What a screen reader announces.

accessibilityHint?string—

Describes the result of pressing, such as "Opens the plan details".

className?string—

Classes merged over the surface.

style?StyleProp<ViewStyle>—

Native style escape hatch for the surface.

testID?string—

Root identifier.

Composition and behavior

  • size sets the layout: large is a long row with the chevron centred at the end, medium a tile for two-column grids, small a compact row.
  • chip sits at the top end in large, beside the chevron in medium (so titles line up across a grid row) and before the chevron in small. A string becomes a soft pill; any node, such as a Badge, replaces it.
  • leading takes an icon or artwork: above the title in medium, at the start in small and large.
  • surface raised uses the deeper shadow-raised lift and a hairline; outline and filled are quieter.
  • With onPress the whole card is one button and shows the chevron; without it the card is static.

Behavior and gestures

  • Use surfaceBackground for a decorative fill, such as the Pro Glass material.
  • With onPress, the whole card is one button: it presses in slightly, gives a light haptic and springs back.
  • Without onPress it's a static surface and the chevron is hidden unless you turn it on.
  • The chip is display only; put separate actions outside the card so there is one target per card.
  • Disabled cards dim and ignore touches.

Accessibility

  • The card is read as one element: the title, the description and a string chip, for example "Card, A token-based surface, Free".
  • Pass accessibilityLabel when the chip is a custom node so its meaning is still spoken.
  • Pressable cards are buttons with at least a 44pt target; add accessibilityHint to say where they lead.
  • Text follows Dynamic Type; descriptions wrap to three, two or one lines by size and then truncate.
  • The chevron mirrors in right-to-left layouts and is hidden from screen readers.

Motion

  • Uses the press motion role, so it follows your app's feel. Pass motion to tune this one instance.
  • Pressing scales the card using the app's press feel, interrupted cleanly if the finger moves away.
  • With Reduce Motion the card stays still and only the haptic and action remain.

Performance

  • No state or timers; the chevron is one small vector, so long lists stay cheap.

Notes for AI

  • Use size large for full-width lists, medium inside a two-column grid and small for dense stacks.
  • Pass chip as a short string for the built-in pill, or a node such as <Badge variant="success">Live</Badge> for custom styling.
  • Set chevron only when the card navigates; leave onPress unset for informational cards.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items