# PressableScale

> Atom — orn-ui

> ⚠️ Requires <UIProvider>: This component (like every orn-ui component) must render inside a <UIProvider> ancestor, or it throws at runtime. See https://orn-ui-docs.vercel.app/getting-started.md

> Runs on Expo SDK 54, 55, 56 and 57, and on bare React Native >=0.81 with react >=19.1. No native modules — works in Expo Go, no prebuild.

## Installation

Install just this component (copies the source into your project, no npm dependency)
```bash
npx orn-ui add pressable-scale
```

Or install the whole package and import it
```tsx
pnpm add orn-ui
import { PressableScale } from 'orn-ui/pressable-scale';
```

Depends on: core (theme + icons)

## Variants

### 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>
```

## Full demo source

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

| Name | Type | Default | Description |
|---|---|---|---|
| `scaleTo?` | `number` | 0.96 | Target scale while pressed. |
| `style?` | `StyleProp<ViewStyle>` | — | — |
| `children` | `ReactNode` | — | Either children or a render prop that receives a boolean reflecting whether the component is currently pressed. |
