Skip to content

[Docs] Clickable#4022

Open
m-bert wants to merge 58 commits intomainfrom
@mbert/clickable-docs
Open

[Docs] Clickable#4022
m-bert wants to merge 58 commits intomainfrom
@mbert/clickable-docs

Conversation

@m-bert
Copy link
Copy Markdown
Contributor

@m-bert m-bert commented Mar 12, 2026

Description

This PR adds docs for Clickable component

Test plan

Read docs 🤓

Copilot AI review requested due to automatic review settings March 12, 2026 15:42
@m-bert m-bert self-assigned this Mar 12, 2026
@m-bert m-bert added the Documentation Documentation change/enhancement label Mar 12, 2026
@m-bert m-bert changed the title @mbert/clickable docs [Docs] Clickable Mar 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR documents the new Clickable component in the Gesture Handler 3 docs and updates migration guidance to position Clickable as the unified replacement for legacy/standard button components.

Changes:

  • Added a new docs page for Clickable and updated the upgrading guide/buttons docs to recommend it.
  • Marked BaseButton, RectButton, and BorderlessButton as deprecated in code comments.
  • Extended Clickable with onPressIn / onPressOut callbacks and wired them into the gesture lifecycle; updated the common app example to log them.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
skills/gesture-handler-3-migration/SKILL.md Updates migration instructions to recommend Clickable for button migrations.
packages/react-native-gesture-handler/src/v3/components/GestureButtons.tsx Adds @deprecated annotations for standard button components.
packages/react-native-gesture-handler/src/v3/components/Clickable/ClickableProps.ts Adds onPressIn / onPressOut to Clickable’s public props.
packages/react-native-gesture-handler/src/v3/components/Clickable/Clickable.tsx Implements onPressIn / onPressOut handling in Clickable.
packages/docs-gesture-handler/docs/guides/upgrading-to-3.mdx Updates upgrade guide “Buttons” section to introduce/recommend Clickable.
packages/docs-gesture-handler/docs/components/clickable.mdx Adds a full Clickable docs page with migration examples and props listing.
packages/docs-gesture-handler/docs/components/buttons.mdx Adds a deprecation warning pointing readers to Clickable.
apps/common-app/src/new_api/components/clickable/index.tsx Updates example usage to include onPressIn / onPressOut.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m-bert m-bert mentioned this pull request Mar 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import HeaderWithBadges from '@site/src/components/HeaderWithBadges';

:::danger
Button components described in this section are deprecated and will be removed in the future. Please use [`Clickable`](/docs/components/clickable) instead.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, maybe we would like to keep RawButton? This would keep more flexibility for advanced users. But that's just a thought, not strong opinion - I'm not sure if we want to do that (cc @j-piasecki, @akwasniewski)

m-bert added a commit that referenced this pull request Apr 1, 2026
## Description

This PR introduces new `Clickable` component, which is meant to be a
replacement for buttons.

> [!NOTE]
> Docs for `Clickable` will be added in #4022, as I don't want to
release them right away after merging this PR.

### `borderless`

For now, `borderless` doesn't work. I've tested clickable with some
changes that allow `borderless` ripple to be visible, however we don't
want to introduce them here because it would break other things. Also it
should be generl fix, not in the PR with new component.

## Stress test

Render list with 2000 buttons 25 times (50ms delay between renders),
drop 3 best and 3 worst results. Then calculate average.

Stress test example is available in this PR. 

#### Android

|           | $t_{Button}$ | $t_{Clickable}$ | $\Delta{t}$  |
|------------------|--------------|-----------------|--------------|
| `BaseButton`       | 1196,18      | 1292,3          | 96,12        |
| `RectButton`       | 1672,6       | 1275,68         | -396,92      |
| `BorderlessButton` | 1451,34      | 1290,74         | -160,6       |

#### iOS

|               | $t_{Button}$ | $t_{Clickable}$ | $\Delta{t}$  |
|------------------|--------------|-----------------|--------------|
| `BaseButton`       | 1101,37      | 1154,6          | 53,23        |
| `RectButton`      | 1528,07      | 1160,07         | -368         |
| `BorderlessButton` | 1330,24      | 1172,69         | -157,55      |


#### Web

|            | $t_{Button}$ | $t_{Clickable}$ | $\Delta{t}$  |
|------------------|--------------|-----------------|--------------|
| `BaseButton`       | 64,18        | 95,57           | 31,39        |
| `RectButton`       | 104,58       | 97,95           | -6,63        |
| `BorderlessButton` | 81,11        | 98,64           | 17,53        |

## Test plan

New examples

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Base automatically changed from @mbert/clickable to main April 1, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation change/enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants