# Pressable (/docs/native/components/pressable)

<Preview id="pressable/named-feedback" title={null} />

## Installation [#installation]

<ComponentInstall name="pressable" />

## Usage [#usage]

```tsx title="app/index.tsx"
import { Pressable } from "@/components/ui/pressable";
import { Text } from "@/components/ui/text";
import { View } from "react-native";

export default function Example() {
  function open() {
    console.log("opened");
  }

  return (
    <View className="flex-1 items-center justify-center p-4">
      <Pressable feedback="scale" haptic="selection" onPress={open}>
        <Text>Open</Text>
      </Pressable>
    </View>
  );
}
```

## Feedback [#feedback]

`scale`, `fade`, `scale-fade` and `none` are the shared vocabulary — every pressable in the library
resolves through it rather than keeping a private map.

<Preview id="pressable/named-feedback" />

```tsx
<Pressable feedback="scale">…</Pressable>
<Pressable feedback="fade">…</Pressable>
<Pressable feedback="scale-fade">…</Pressable>
<Pressable feedback="none">…</Pressable>
```

## Explicit values [#explicit-values]

`pressedScale` and `pressedOpacity` win on the axis they name and leave the other to `feedback`.

```tsx
<Pressable pressedScale={0.92}>…</Pressable>
<Pressable feedback="scale" pressedOpacity={0.5}>…</Pressable>
```

## Disabled and busy [#disabled-and-busy]

Both block the gesture; only `disabled` announces the control as disabled. Use `busy` for a
temporary state the component clears itself.

```tsx
<Pressable disabled>…</Pressable>
<Pressable busy>…</Pressable>
```

## Haptics [#haptics]

`haptic` plays inside the gesture worklet, so the tap and the haptic land in the same frame.

<Preview id="pressable/haptics" />

```tsx
<Pressable haptic="selection">…</Pressable>
```

## asChild [#aschild]

Renders into the single child element instead of emitting a `View`.

<Preview id="pressable/as-child" />

```tsx
<Pressable asChild haptic="medium">
  <View className="rounded-xl border border-border bg-card p-4">…</View>
</Pressable>
```

## Worklets [#worklets]

Cross back to JS with `scheduleOnRN` from `react-native-worklets`, never Reanimated's `runOnJS` —
since Reanimated 4 that is a deprecated shim forwarding to exactly this call.

```tsx
scheduleOnRN(onPress);          // not runOnJS(onPress)()
```

## API Reference [#api-reference]

Every pressable in the library extends this — `Button`, `ListGroup.Item`, `Accordion.Trigger`,
`Checkbox` and `Radio` all inherit the vocabulary rather than restating it. `ViewProps` passes
through, minus `style`.

<TypeTable
  type={{
    feedback: {
      type: '"scale" | "fade" | "scale-fade" | "none"',
      description: "How the press moves the element. `pressedScale` / `pressedOpacity` still win on the axis they name.",
    },
    pressedScale: { type: "number", description: "Scale at full press. 1 disables the scale, and overrides `feedback`." },
    pressedOpacity: { type: "number", description: "Opacity at full press. 1 disables the fade, and overrides `feedback`." },
    haptic: {
      type: 'false | "selection" | "light" | "medium" | "heavy" | "success" | "warning" | "error"',
      default: "false",
      description: "Played on press-in, from the UI thread — the tap and the haptic land in the same frame.",
    },
    onPress: { type: "() => void" },
    onLongPress: { type: "() => void" },
    disabled: { type: "boolean", description: "Blocks the gesture and announces the control as disabled." },
    busy: {
      type: "boolean",
      description: "Blocks the gesture and announces the control as busy, not disabled. For a temporary state the component clears itself.",
    },
    asChild: { type: "boolean", description: "Render into the single child element instead of emitting a View." },
    className: { type: "string" },
    children: { type: "ReactNode" },
    ref: { type: "Ref<Animated.View>" },
  }}
/>

Neither `disabled` nor `busy` applies any opacity of its own — that is the caller's variant's job.
A bare `Pressable` with no `feedback` presses to `{ opacity: 0.9, scale: 0.97 }`, which fades less
than `fade` does.

### Exports [#exports]

```tsx
import {
  Pressable,
  type PressableProps,
  type HapticFeedback,
  PRESSABLE_FEEDBACK,
  PRESSABLE_FEEDBACKS,
  PRESSABLE_FEEDBACK_FALLBACK,
  resolvePressedState,
} from "@delacour/react-native-ui/pressable";
```
