# Card

> Atom — orn-ui

> ⚠️ Requiere <UIProvider>: Este componente (como todos los de orn-ui) debe renderizarse dentro de un ancestro <UIProvider>, o lanza un error en runtime. See https://orn-ui-docs.vercel.app/getting-started.md

> Corre en Expo SDK 54, 55, 56 y 57, y en React Native puro >=0.81 con react >=19.1. Sin módulos nativos — funciona en Expo Go, sin prebuild.

## Instalación

Instala solo este componente (copia el código fuente a tu proyecto, sin dependencia npm)
```bash
npx orn-ui add card
```

O instala el paquete completo e impórtalo
```tsx
pnpm add orn-ui
import { Card } from 'orn-ui/card';
```

Depende de: core (theme + icons)

## Variantes

### Default

```tsx
<Card>
  <Title>Invoice #1042</Title>
  <Body>Due in 5 days · $340.00</Body>
</Card>
```

### Composed

```tsx
<Card>
  <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 8 }}>
    <Title>Invoice #1043</Title>
    <Badge label="PAID" variant="success" />
  </View>
  <KeyValueRow label="Total" value="$1,240.00" />
</Card>
```

### Custom style

```tsx
<Card style={{ backgroundColor: '#004cef', borderRadius: 24 }}>
  <Title style={{ color: '#fff' }}>Highlighted card</Title>
</Card>
```

## Código completo del demo

```tsx
const variants: VariantDef[] = [
  {
    label: 'Default',
    content: (
      <Card>
        <Title>Invoice #1042</Title>
        <Body>Due in 5 days · $340.00</Body>
      </Card>
    ),
  },
  {
    label: 'Composed',
    content: (
      <Card>
        <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 8 }}>
          <Title>Invoice #1043</Title>
          <Badge label="PAID" variant="success" />
        </View>
        <KeyValueRow label="Total" value="$1,240.00" />
      </Card>
    ),
  },
  {
    label: 'Custom style',
    content: (
      <Card style={{ backgroundColor: '#004cef', borderRadius: 24 }}>
        <Title style={{ color: '#fff' }}>Highlighted card</Title>
      </Card>
    ),
  },
];
return <VariantList variants={variants} />;
```

## Props

| Nombre | Tipo | Por defecto | Descripción |
|---|---|---|---|
| `style?` | `ViewStyle` | — | — |
