# PressableScale

> 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 pressable-scale
```

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

Depende de: core (theme + icons)

## Variantes

### Default (0.96)

```tsx
<PressableScale onPress={() => {}}>
  <Card>
    <Body>Press me — I scale down.</Body>
  </Card>
</PressableScale>
```

### scaleTo=0.85

```tsx
<PressableScale onPress={() => {}} scaleTo={0.85}>
  <Card>
    <Body>A bigger squeeze on press.</Body>
  </Card>
</PressableScale>
```

## Código completo del demo

```tsx
const variants: VariantDef[] = [
  {
    label: 'Default (0.96)',
    content: (
      <PressableScale onPress={() => {}}>
        <Card>
          <Body>Press me — I scale down.</Body>
        </Card>
      </PressableScale>
    ),
  },
  {
    label: 'scaleTo=0.85',
    content: (
      <PressableScale onPress={() => {}} scaleTo={0.85}>
        <Card>
          <Body>A bigger squeeze on press.</Body>
        </Card>
      </PressableScale>
    ),
  },
];
return <VariantList variants={variants} />;
```

## Props

| Nombre | Tipo | Por defecto | Descripción |
|---|---|---|---|
| `scaleTo?` | `number` | 0.96 | Escala objetivo al presionar. |
| `style?` | `StyleProp<ViewStyle>` | — | — |
| `children` | `ReactNode` | — | Los children, o una render prop que recibe un booleano indicando si el componente está presionado. |
