Home
Softono
c

callstack

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
11

Software by callstack

agent-device
Open Source

agent-device

<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=agent-device" align="center"> <picture> <img alt="agent-device: device automation CLI for AI agents" src="website/docs/public/agent-device-banner.jpg"> </picture> </a> --- # agent-device [![npm version](https://img.shields.io/npm/v/agent-device.svg)](https://www.npmjs.com/package/agent-device) [![CI](https://github.com/callstackincubator/agent-device/actions/workflows/ci.yml/badge.svg)](https://github.com/callstackincubator/agent-device/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/license-MIT-black.svg)](LICENSE) [![Glama MCP server](https://glama.ai/mcp/servers/callstackincubator/agent-device/badges/score.svg)](https://glama.ai/mcp/servers/callstackincubator/agent-device) Mobile app verification for AI agents. A device automation CLI for real apps on iOS, Android, TV, and desktop. Agents get token-efficient snapshots, semantic refs, and evidence captured only when needed. `agent-device` lets coding agents open apps, inspect the current UI, interact with visible elements, and collect debugging evidence through one CLI. Use it when an agent needs to verify what actually happens on a device, not just reason about code. If you know Vercel's [agent-browser](https://github.com/vercel-labs/agent-browser), `agent-device` is the same idea for mobile, TV, and desktop apps. It works with native iOS and Android apps, plus apps built with Expo, Flutter, and React Native, as long as the target can run on a supported device, simulator, emulator, or desktop environment. ![agent-device demo showing Codex using agent-device to create a new contact in the iOS Contacts app from a simple prompt](./website/docs/public/agent-device-contacts.gif) ## Capabilities - **Inspect** real app UI through compact accessibility snapshots, interactive refs like `@e3`, selectors, and React Native component trees. - **Interact** by opening apps, tapping, typing, scrolling, performing gestures, waiting, asserting state, handling alerts, and closing sessions. - **Capture evidence** with screenshots, videos, logs, traces, network traffic, performance samples, crash context, and React profiles. - **Replay workflows** by recording `.ad` scripts for local runs, CI, and repeatable e2e checks. - **Run across platforms** with iOS Simulator automation, Android Emulator automation, physical devices, tvOS, Android TV, macOS, Linux, and desktop app automation, so agents can see and feel the app they work on. ## Use Cases - Verify mobile changes on real devices, simulators, and emulators before review or merge. - Give AI coding agents a real app feedback loop while they implement features. - Debug regressions with screenshots, logs, traces, network evidence, and crash context. - Profile performance issues with CPU/memory samples and React render profiles when needed. - Turn exploratory app interactions into replayable e2e checks for CI. - Use one agent workflow across native iOS, Android, Expo, Flutter, React Native, TV, and desktop apps. ![Sketch showing agent-device as the live app verification layer in the agentic development loop](./website/docs/public/agentic-development-loop.svg) ## Quick Start Install the CLI: ```bash npm install -g agent-device@latest agent-device --version agent-device help workflow ``` The installed CLI help is the source of truth for agents. Start with `agent-device help workflow`, then follow the topic-specific help when a task needs dogfooding, debugging, replay, or React Native profiling. Prerequisites depend on the target platform: Node.js 22+, Xcode for iOS/tvOS/macOS targets, Android SDK + ADB for Android, and macOS Accessibility permission for desktop automation. See [Installation](https://oss.callstack.com/agent-device/docs/installation) for platform setup. Try the basic loop: ```bash # Find an app. agent-device apps --platform ios agent-device apps --platform android # Start a session. agent-device open SampleApp --platform ios # Inspect the current screen. -i returns interactive elements only. agent-device snapshot -i # @e1 [heading] "Settings" # @e2 [button] "Sign In" # @e3 [text-field] "Email" # Act, capture evidence, and close. agent-device fill @e3 "[email protected]" agent-device screenshot ./artifacts/settings.png agent-device close ``` Snapshots assign refs like `@e1`, `@e2`, and `@e3` to elements on the current screen. Refs from the latest snapshot are immediately actionable; after scrolling or changing screens, take a fresh snapshot. ## Next Steps - **Set up your agent**: run the CLI from Cursor, Codex, Claude Code, Windsurf, or another agent terminal. For skills, rules, direct MCP tools, and client-specific setup, see [AI Agent Setup](https://oss.callstack.com/agent-device/docs/agent-setup). - **Try the sample app**: clone the repo and run the bundled Expo fixture when you want a guided first dogfood run with screenshots, replay, and performance evidence. See [Quick Start](https://oss.callstack.com/agent-device/docs/quick-start). - **Go deeper**: use [Commands](https://oss.callstack.com/agent-device/docs/commands), [Replay & E2E](https://oss.callstack.com/agent-device/docs/replay-e2e), and [Debugging & Profiling](https://oss.callstack.com/agent-device/docs/debugging-profiling) for production workflows. ## Where To Run agent-device | Path | Best for | Start with | | --- | --- | --- | | Local | Exploration, debugging, and development loops on simulators, emulators, physical devices, macOS apps, and Linux desktop targets. | Follow the Quick Start. | | CI/CD | Automated PR and merge validation with replay scripts and captured artifacts. | Try the [EAS workflow template](https://github.com/callstackincubator/eas-agent-device/blob/main/.eas/workflows/agent-qa-mobile.yml). GitHub Actions template coming soon. | | Cloud / remote execution | Linux runners, managed devices, and remote execution. | Use [Agent Device Cloud](https://agent-device.dev/cloud), see [Commands](https://oss.callstack.com/agent-device/docs/commands) for remote profiles, or [contact Callstack](mailto:[email protected]) for team-scale QA. | ## How It Works `agent-device` runs session-aware commands through platform backends: XCTest for iOS and tvOS, ADB plus the Android snapshot helper for Android, a local helper for macOS desktop automation, and AT-SPI for Linux desktop targets. Node consumers can use the typed client and public subpaths for bridge integrations. `agent-device/android-adb` exposes the Android ADB provider contract, logcat/clipboard/keyboard/app helpers, and port reverse management. ## FAQ ### What is agent-device? `agent-device` is a device automation CLI for AI mobile app testing. It lets AI agents verify real apps on iOS, Android, TV, desktop, simulators, emulators, and physical devices. ### Does it work with React Native, Expo, Flutter, and native apps? Yes. `agent-device` works with native iOS and Android apps, Expo apps, Flutter apps, React Native apps, TV apps, and desktop apps that run on supported targets. ### How is it different from Appium, Detox, or Maestro? Appium, Detox, and Maestro are traditional mobile automation frameworks. `agent-device` is optimized for AI agents that need to inspect app state, interact semantically, capture evidence, debug, profile, and turn useful explorations into replayable checks. ## Used By Used by teams and developers at Callstack, Expensify, Shopify, Kindred, Total Wine & More, LegendList, HerLyfe, App & Flow, and more. ## Documentation - [Docs](https://oss.callstack.com/agent-device/) - [Agent-readable docs](https://oss.callstack.com/agent-device/llms-full.txt) ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md). ## Made at Callstack `agent-device` is open source and MIT licensed. Visit [agent-device.dev](https://agent-device.dev/), try the [EAS workflow template](https://github.com/callstackincubator/eas-agent-device/blob/main/.eas/workflows/agent-qa-mobile.yml), read the [docs](https://oss.callstack.com/agent-device/), or contact us at [email protected].

Mobile Development AI Agents
2.6K Github Stars
react-native-paper
Open Source

react-native-paper

<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-paper" align="center"> <img alt="react-native-paper" src="https://github.com/user-attachments/assets/5c62c47c-7991-4189-be21-614d4ffa9029"> </a> <h3 align="center"> Material design for React Native.<br/> <a href="https://reactnativepaper.com">reactnativepaper.com</a> </h3> --- [![Greenkeeper badge](https://badges.greenkeeper.io/callstack/react-native-paper.svg)](https://greenkeeper.io/) [![Build Status][build-badge]][build] [![Version][version-badge]][package] [![MIT License][license-badge]][license] [![All Contributors][all-contributors-badge]][all-contributors] [![PRs Welcome][prs-welcome-badge]][prs-welcome] [![Chat][chat-badge]][chat] [![Sponsored by Callstack][callstack-badge]][callstack] <p align="center"><i>React Native Paper is the cross-platform UI kit library containing a collection of customizable and production-ready components, which by default are following and respecting the Google’s Material Design guidelines.</i></p> ## Getting Started Refer to the [getting started guide](https://callstack.github.io/react-native-paper/docs/guides/getting-started) for instructions. ## Documentation Check the components and their usage in our [documentation](https://callstack.github.io/react-native-paper). ## Features - Follows [material design guidelines](https://m3.material.io/get-started/) - Works on both iOS and Android following [platform adaptation guidelines](https://material.io/design/platform-guidance/cross-platform-adaptation.html) - Full [theming support](https://callstack.github.io/react-native-paper/docs/guides/theming) ## Try it out 🧑‍💻 Run the [example app](https://snack.expo.dev/@react-native-paper/react-native-paper-example_v5) with [Expo](https://expo.dev/) to see it in action. The source code for the examples are under the [/example](/example) folder. 📲 You can also try out components in our demo apps available in the both stores [Android](https://play.google.com/store/apps/details?id=com.callstack.reactnativepaperexample&hl=pl&gl=US) and [ iOS](https://apps.apple.com/app/react-native-paper/id1548934513). ## Contributing Read the [contribution guidelines](/CONTRIBUTING.md) before contributing. ## Figma and Sketch component kits Use official component kits provided by [Material Design](https://m3.material.io/). ## Made with ❤️ at Callstack `react-native-paper` is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack][callstack-readme-with-love] is a group of React and React Native geeks, contact us at [[email protected]](mailto:[email protected]) if you need any help with these or just want to say hi! Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥 <!-- badges --> [build-badge]: https://img.shields.io/circleci/project/github/callstack/react-native-paper/main.svg?style=flat-square [build]: https://circleci.com/gh/callstack/react-native-paper [version-badge]: https://img.shields.io/npm/v/react-native-paper.svg?style=flat-square [package]: https://www.npmjs.com/package/react-native-paper [license-badge]: https://img.shields.io/npm/l/react-native-paper.svg?style=flat-square [license]: https://opensource.org/licenses/MIT [all-contributors-badge]: https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square [all-contributors]: #contributors [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square [prs-welcome]: http://makeapullrequest.com [chat-badge]: https://img.shields.io/discord/426714625279524876.svg?style=flat-square&colorB=758ED3 [chat]: https://discord.gg/zwR2Cdh [callstack-badge]: https://callstack.com/images/callstack-badge.svg [callstack]: https://callstack.com/open-source/?utm_source=github.com&utm_medium=referral&utm_campaign=react-native-paper&utm_term=readme-badge [callstack-readme-with-love]: https://callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=react-native-paper&utm_term=readme-with-love ## Contributors Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)): <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore --> <table> <tr> <td align="center"><a href="https://twitter.com/@satya164"><img src="https://avatars2.githubusercontent.com/u/1174278?v=4" width="100px;" alt="Satyajit Sahoo"/><br /><sub><b>Satyajit Sahoo</b></sub></a><br /><a href="#ideas-satya164" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/callstack/react-native-paper/commits?author=satya164" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=satya164" title="Documentation">📖</a></td> <td align="center"><a href="https://ferrannp.com/"><img src="https://avatars2.githubusercontent.com/u/774577?v=4" width="100px;" alt="Ferran Negre"/><br /><sub><b>Ferran Negre</b></sub></a><br /><a href="#ideas-ferrannp" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/callstack/react-native-paper/commits?author=ferrannp" title="Code">💻</a></td> <td align="center"><a href="http://dawidurbaniak.pl"><img src="https://avatars3.githubusercontent.com/u/18584155?v=4" width="100px;" alt="Dawid"/><br /><sub><b>Dawid</b></sub></a><br /><a href="#ideas-Trancever" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/callstack/react-native-paper/commits?author=Trancever" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=Trancever" title="Documentation">📖</a></td> <td align="center"><a href="https://twitter.com/esemesek"><img src="https://avatars2.githubusercontent.com/u/9092510?v=4" width="100px;" alt="Kacper Wiszczuk"/><br /><sub><b>Kacper Wiszczuk</b></sub></a><br /><a href="#ideas-Esemesek" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/callstack/react-native-paper/commits?author=Esemesek" title="Code">💻</a></td> <td align="center"><a href="https://medium.com/@_happiryu"><img src="https://avatars1.githubusercontent.com/u/22746080?v=4" width="100px;" alt="Luke Walczak"/><br /><sub><b>Luke Walczak</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=lukewalczak" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=lukewalczak" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/ahmedlhanafy"><img src="https://avatars2.githubusercontent.com/u/7052827?v=4" width="100px;" alt="Ahmed Elhanafy"/><br /><sub><b>Ahmed Elhanafy</b></sub></a><br /><a href="#ideas-ahmedlhanafy" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/callstack/react-native-paper/commits?author=ahmedlhanafy" title="Code">💻</a></td> <td align="center"><a href="https://github.com/kpsroka"><img src="https://avatars0.githubusercontent.com/u/24893014?v=4" width="100px;" alt="K. P. Sroka"/><br /><sub><b>K. P. Sroka</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=kpsroka" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=kpsroka" title="Documentation">📖</a></td> </tr> <tr> <td align="center"><a href="https://github.com/iyadthayyil"><img src="https://avatars2.githubusercontent.com/u/11161020?v=4" width="100px;" alt="Iyad Thayyil"/><br /><sub><b>Iyad Thayyil</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=iyadthayyil" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=iyadthayyil" title="Documentation">📖</a></td> <td align="center"><a href="http://hundeloh-consulting.ch/"><img src="https://avatars1.githubusercontent.com/u/5358638?v=4" width="100px;" alt="Julian Hundeloh"/><br /><sub><b>Julian Hundeloh</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=jaulz" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=jaulz" title="Documentation">📖</a></td> <td align="center"><a href="https://www.linkedin.com/in/grzegorzgawrysiak/"><img src="https://avatars3.githubusercontent.com/u/7827311?v=4" width="100px;" alt="Grzegorz Gawrysiak"/><br /><sub><b>Grzegorz Gawrysiak</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=gawrysiak" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=gawrysiak" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/luissmg"><img src="https://avatars2.githubusercontent.com/u/20660551?v=4" width="100px;" alt="Luís"/><br /><sub><b>Luís</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=luissmg" title="Code">💻</a></td> <td align="center"><a href="https://raajnadar.in"><img src="https://avatars1.githubusercontent.com/u/17236768?v=4" width="100px;" alt="Rajendran Nadar"/><br /><sub><b>Rajendran Nadar</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=raajnadar" title="Code">💻</a></td> <td align="center"><a href="https://github.com/brentvatne"><img src="https://avatars2.githubusercontent.com/u/90494?v=4" width="100px;" alt="Brent Vatne"/><br /><sub><b>Brent Vatne</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=brentvatne" title="Code">💻</a></td> <td align="center"><a href="https://jukben.cz"><img src="https://avatars3.githubusercontent.com/u/8135252?v=4" width="100px;" alt="Jakub Beneš"/><br /><sub><b>Jakub Beneš</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=jukben" title="Code">💻</a></td> </tr> <tr> <td align="center"><a href="https://twitter.com/_panpawel"><img src="https://avatars3.githubusercontent.com/u/3886886?v=4" width="100px;" alt="Paweł Szymański"/><br /><sub><b>Paweł Szymański</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=pan-pawel" title="Code">💻</a> <a href="https://github.com/callstack/react-native-paper/commits?author=pan-pawel" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/jayu"><img src="https://avatars1.githubusercontent.com/u/11561585?v=4" width="100px;" alt="Kuba"/><br /><sub><b>Kuba</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=jayu" title="Code">💻</a> <a href="#ideas-jayu" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center"><a href="https://github.com/jbinda"><img src="https://avatars2.githubusercontent.com/u/21242757?v=4" width="100px;" alt="jbinda"/><br /><sub><b>jbinda</b></sub></a><br /><a href="https://github.com/callstack/react-native-paper/commits?author=jbinda" title="Code">💻</a> <a href="#ideas-jbinda" title="Ideas, Planning, & Feedback">🤔</a></td> </tr> </table> <!-- ALL-CONTRIBUTORS-LIST:END --> This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

CSS Frameworks & UI Kits Mobile Development
14.4K Github Stars
haul
Open Source

haul

<p align="center"> <img alt="Haul" src="https://cloud.githubusercontent.com/assets/1174278/24502391/25619f98-156b-11e7-994c-a8495b4735d5.png" width="512"> </p> <p align="center"> A command line tool for developing React Native apps </p> --- [![Build Status][build-badge]][build] [![MIT License][license-badge]][license] [![PRs Welcome][prs-welcome-badge]][prs-welcome] [![Code of Conduct][coc-badge]][coc] [![Chat][chat-badge]][chat] [![tweet][tweet-badge]][tweet] --- ## Notice We're actively working on a Haul successor, which would provide long awaited features like Hot Module Replacement + React Refresh and better feature-parity with Metro. The version `1.0.0` is already released! If you're investigating using Haul, we highly recommend giving a [Re.pack](https://github.com/callstack/repack) a go. If you're already using Haul, we recommend migrating to [Re.pack](https://github.com/callstack/repack) for better developer experience and feature set. The migration process is fairly straighforward, since you now have full access to `webpack.config.js`. --- Haul is a drop-in replacement for `react-native` CLI built on open tools like Webpack. It can act as a development server or bundle your React Native app for production. `@haul-bundler/cli` and other packages under `@haul-bundler` scope are a overhaul of `haul` package __and support only React Native 0.59.0 and above__. If you need to support older versions, please check [`legacy` branch](https://github.com/callstack/haul/tree/legacy). `@haul-bundler/cli` and other packages __requires Node 10 to be installed__. If you're running older version, please upgrade to Node 10 LTS or newer. ## Features - Replaces React Native packager to bundle your app - Access to full webpack ecosystem, using additional loaders and plugins is simple - Doesn't need watchman, symlinks work nicely - Helpful and easy to understand error messages ## Packages | Name | Version | Description | Required | | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | | `@haul-bundler/cli` | [![cli version][version-cli]][package-cli] | CLI and commands implementation. | Yes | | `@haul-bundler/core` | [![core version][version-core]][package-core] | Core logic and functionality. | Yes (installed with `cli`) | | `@haul-bundler/core-legacy` | [![core-legacy version][version-core-legacy]][package-core-legacy] | Legacy logic from `haul` package | Yes (installed with `cli`) | | `@haul-bundler/babel-preset-react-native` | [![babel-preset-react-native version][version-babel-preset-react-native]][package-babel-preset-react-native] | Babel preset tweaked for RN 0.59+, which can decrease the bundle size by using only the necessary transforms. | Yes (installed by `init` command) | | `@haul-bundler/basic-bundle-webpack-plugin` | [![basic-bundle-webpack-plugin version][version-basic-bundle-webpack-plugin]][package-basic-bundle-webpack-plugin] | Webpack plugin with tweaks for plain JS bundle. | Yes (installed with `cli`) | | `@haul-bundler/ram-bundle-webpack-plugin` | [![ram-bundle-webpack-plugin version][version-ram-bundle-webpack-plugin]][package-ram-bundle-webpack-plugin] | Webpack plugin for RAM bundle support. | Yes (installed with `cli`) | | `@haul-bundler/preset-0.59` | [![preset-0.59 version][version-preset-0.59]][package-preset-0.59] | Preset with configuration tweaked for RN 0.59. | Yes (installed by `init` command when using RN 0.59) | | `@haul-bundler/preset-0.60` | [![preset-0.60 version][version-preset-0.60]][package-preset-0.60] | Preset with configuration tweaked for RN 0.60. | Yes (installed by `init` command when using RN 0.60) | | `@haul-bundler/explore` | [![explore version][version-explore]][package-explore] | Explore and analyse generated bundle | No (optional) | ## Getting started Start by adding Haul as a dependency to your React Native project (use `react-native init MyProject` to create one if you don't have a project): ```bash yarn add --dev @haul-bundler/cli # Traditionalist? No problem: npm install --save-dev @haul-bundler/cli ``` To configure your project to use haul, run the following: ```bash yarn haul init # npm >= 5.2.0 : npx haul init # npm < 5.2.0 : npm install -g npx npx haul init ``` This will automatically add the configuration needed to make Haul work with your app, e.g. add `haul.config.js` to your project, which you can customize to add more functionality. Next, you're ready to start the development server: ```bash yarn haul start # Or: npx haul start ``` Finally, reload your app to update the bundle or run your app just like you normally would: ```bash react-native run-ios ``` <p align="center"> <img width="635" src="./docs/img/packager_server.gif" /> </p> ## Documentation Check out the docs to learn more about available commands and tips on customizing the webpack configuration. 1. [CLI Commands](docs/CLI%20Commands.md) 2. [Configuration](docs/Configuration.md) 3. [Recipes](docs/Recipes.md) 4. [Migration guide](docs/Migration.md) <!-- ### Hot Module Replacement __Hot Module Replacement is an experimental feature and it's disabled by default.__ Please refer to the [Setup guide](./docs/HMR_Setup.md). --> ## Limitations Haul uses a completely different architecture from React Native packager, which means there are some things which don't work quite the same. * Delta Bundles (RN 0.52+) have minimal support * Existing `react-native` commands * No support for Hot Module Replacement The following features are **unlikely to be supported** in the future: - Haste module system: use something like [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver) instead - Transpile files under `node_modules`: transpile your modules before publishing, or configure webpack not to ignore them ## Made with ❤️ at Callstack Haul is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack][callstack-readme-with-love] is a group of React and React Native geeks, contact us at [[email protected]](mailto:[email protected]) if you need any help with these or just want to say hi! Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥 <!-- badges --> [build-badge]: https://img.shields.io/circleci/project/github/callstack/haul/master.svg?style=flat-square [build]: https://circleci.com/gh/callstack/haul [license-badge]: https://img.shields.io/npm/l/@haul-bundler/cli.svg?style=flat-square [license]: https://github.com/callstack/haul/blob/master/LICENSE [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square [prs-welcome]: http://makeapullrequest.com [coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square [coc]: https://github.com/callstack/haul/blob/master/CODE_OF_CONDUCT.md [chat-badge]: https://img.shields.io/discord/426714625279524876.svg?style=flat-square&colorB=758ED3 [chat]: https://discord.gg/zwR2Cdh [tweet-badge]: https://img.shields.io/badge/tweet-%23haul-blue.svg?style=flat-square&colorB=1DA1F2&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAUCAYAAACXtf2DAAAAAXNSR0IArs4c6QAAAaRJREFUOBGtlM8rBGEYx3cWtRHJRaKcuMtBSitxkCQ3LtzkP9iUUu5ODspRHLhRLtq0FxeicEBC2cOivcge%2FMgan3fNM8bbzL4zm6c%2BPT%2Fe7%2FO8887svrFYBWbbtgWzsAt3sAcpqJFxxF1QV8oJFqFPFst5dLWQAT87oTgPB7DtziFRT1EA4yZolsFkhwjGYFRO8Op0KD8HVe7unoB6PRTBZG8IctAmG1xrHcfkQ2B55sfI%2ByGMXSBqV71xZ8CWdxBxN6ThFuECDEAL%2Bc9HIzDYumVZ966GZnX0SzCZvEqTbkaGywkyFE6hKAsBPhFQ18uPUqh2ggJ%2BUor%2F4M%2F%2FzOC8g6YzR1i%2F8g4vvSI%2ByD7FFNjexQrjHd8%2BnjABI3AU4Wl16TuF1qANGll81jsi5qu%2Bw6XIsCn4ijhU5FmCJpkV6BGNw410hfSf6JKBQ%2FUFxHGYBnWnmOwDwYQ%2BwzdHqO75HtiAMJfaC7ph32FSRJCENUhDHsLaJkL%2FX4wMF4%2BwA5bgAcrZE4sr0Cu9Jq9fxyrvBHWbNkMD5CEHWTjjT2m6r5D92jfmbbKJEWuMMAAAAABJRU5ErkJggg%3D%3D [tweet]: https://twitter.com/intent/tweet?text=Check%20out%20Haul!%20https://github.com/callstack/haul%20%F0%9F%91%8D [callstack-readme-with-love]: https://callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=react-native-paper&utm_term=readme-with-love [version-cli]: https://img.shields.io/npm/v/@haul-bundler/cli.svg?style=flat-square [package-cli]: https://www.npmjs.com/package/@haul-bundler/cli [version-core]: https://img.shields.io/npm/v/@haul-bundler/core.svg?style=flat-square [package-core]: https://www.npmjs.com/package/@haul-bundler/core [version-core-legacy]: https://img.shields.io/npm/v/@haul-bundler/core-legacy.svg?style=flat-square [package-core-legacy]: https://www.npmjs.com/package/@haul-bundler/core-legacy [version-babel-preset-react-native]: https://img.shields.io/npm/v/@haul-bundler/babel-preset-react-native.svg?style=flat-square [package-babel-preset-react-native]: https://www.npmjs.com/package/@haul-bundler/babel-preset-react-native [version-basic-bundle-webpack-plugin]: https://img.shields.io/npm/v/@haul-bundler/basic-bundle-webpack-plugin.svg?style=flat-square [package-basic-bundle-webpack-plugin]: https://www.npmjs.com/package/@haul-bundler/basic-bundle-webpack-plugin [version-ram-bundle-webpack-plugin]: https://img.shields.io/npm/v/@haul-bundler/ram-bundle-webpack-plugin.svg?style=flat-square [package-ram-bundle-webpack-plugin]: https://www.npmjs.com/package/@haul-bundler/ram-bundle-webpack-plugin [version-preset-0.59]: https://img.shields.io/npm/v/@haul-bundler/preset-0.59.svg?style=flat-square [package-preset-0.59]: https://www.npmjs.com/package/@haul-bundler/preset-0.59 [version-preset-0.60]: https://img.shields.io/npm/v/@haul-bundler/preset-0.60.svg?style=flat-square [package-preset-0.60]: https://www.npmjs.com/package/@haul-bundler/preset-0.60 [version-explore]: https://img.shields.io/npm/v/@haul-bundler/explore.svg?style=flat-square [package-explore]: https://www.npmjs.com/package/@haul-bundler/explore

Developer Tools Terminal & CLI Tools
3.7K Github Stars
react-native-testing-library
Open Source

react-native-testing-library

<div align="center"> <a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-testing-library" align="center"> <img src="https://github.com/user-attachments/assets/4d452312-4ffd-4439-855f-a9b12ad7d6c2" alt="React Native Testing Library" /> </a> <p align="center">Developer-friendly and complete React Native testing utilities that encourage good testing practices.</p> </div> [![Version][version-badge]][package] [![Build Status][build-badge]][build] [![Code Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] [![MIT License][license-badge]][license] [![Sponsored by Callstack][callstack-badge]][callstack] ## The problem You want to write maintainable tests for your React Native components. Your tests should avoid implementation details and focus on giving you confidence. They should remain maintainable so refactors (changes to implementation but not functionality) don't break your tests and slow you and your team down. ## This solution The React Native Testing Library (RNTL) tests React Native components. It simulates the React Native runtime on top of [Test Renderer](https://github.com/mdjastrzebski/test-renderer) and encourages better testing practices. Its primary guiding principle is: > The more your tests resemble the way your software is used, the more confidence they can give you. This project is inspired by [React Testing Library](https://github.com/testing-library/react-testing-library). Tested to work with Jest, but it should work with other test runners as well. ## Installation Open a Terminal in your project's folder and run: ```sh npm install --save-dev @testing-library/react-native ``` This library has a `peerDependencies` listing for [Test Renderer](https://github.com/mdjastrzebski/test-renderer). Make sure to install it as a dev dependency: ```sh npm install --save-dev test-renderer ``` ### Additional Jest matchers You can use the built-in Jest matchers automatically by having any import from `@testing-library/react-native` in your test. ## Example ```jsx import { render, screen, userEvent } from '@testing-library/react-native'; import { QuestionsBoard } from '../QuestionsBoard'; test('form submits two answers', async () => { const questions = ['q1', 'q2']; const onSubmit = jest.fn(); const user = userEvent.setup(); await render(<QuestionsBoard questions={questions} onSubmit={onSubmit} />); const answerInputs = screen.getAllByLabelText('answer input'); // simulates the user focusing on TextInput and typing text one char at a time await user.type(answerInputs[0], 'a1'); await user.type(answerInputs[1], 'a2'); // simulates the user pressing on any pressable element await user.press(screen.getByRole('button', { name: 'Submit' })); expect(onSubmit).toHaveBeenCalledWith({ 1: { q: 'q1', a: 'a1' }, 2: { q: 'q2', a: 'a2' }, }); }); ``` You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/questionsBoard.test.tsx). ## API / Usage React Native Testing Library consists of following APIs: - [`render` function](https://oss.callstack.com/react-native-testing-library/docs/api/render) - render your UI components for testing purposes - [`screen` object](https://oss.callstack.com/react-native-testing-library/docs/api/screen) - access rendered UI: - [Queries](https://oss.callstack.com/react-native-testing-library/docs/api/queries) - find rendered components by various predicates: role, text, test ids, etc - Lifecycle methods: [`rerender`](https://oss.callstack.com/react-native-testing-library/docs/api/screen#rerender), [`unmount`](https://oss.callstack.com/react-native-testing-library/docs/api/screen#unmount) - Helpers: [`debug`](https://oss.callstack.com/react-native-testing-library/docs/api/screen#debug), [`toJSON`](https://oss.callstack.com/react-native-testing-library/docs/api/screen#tojson), [`root`](https://oss.callstack.com/react-native-testing-library/docs/api/screen#root), [`container`](https://oss.callstack.com/react-native-testing-library/docs/api/screen#container) - [Jest matchers](https://oss.callstack.com/react-native-testing-library/docs/api/jest-matchers) - validate assumptions about your UI - [User Event](https://oss.callstack.com/react-native-testing-library/docs/api/events/user-event) - simulate common user interactions like [`press`](https://oss.callstack.com/react-native-testing-library/docs/api/events/user-event#press) or [`type`](https://oss.callstack.com/react-native-testing-library/docs/api/events/user-event#type) - [Fire Event](https://oss.callstack.com/react-native-testing-library/docs/api/events/fire-event) - simulate any component event - [`renderHook` function](https://oss.callstack.com/react-native-testing-library/docs/api/misc/render-hook) - render hooks for testing purposes - Miscellaneous APIs: - [Async utils](https://oss.callstack.com/react-native-testing-library/docs/api/misc/async): `findBy*` queries, `waitFor`, `waitForElementToBeRemoved` - [Configuration](https://oss.callstack.com/react-native-testing-library/docs/api/misc/config): `configure`, `resetToDefaults` - [Accessibility](https://oss.callstack.com/react-native-testing-library/docs/api/misc/accessibility): `isHiddenFromAccessibility` - [Other](https://oss.callstack.com/react-native-testing-library/docs/api/misc/other): `within`, `act`, `cleanup` ## Migration Guides - **[Migration to 14.0](https://oss.callstack.com/react-native-testing-library/docs/start/migration-v14)** - Drops React 18, async APIs by default ## Troubleshooting - [Troubleshooting guide](https://oss.callstack.com/react-native-testing-library/docs/guides/troubleshooting) ## Community Resources Check out our list of [Community Resources about RNTL](https://oss.callstack.com/react-native-testing-library/docs/guides/community-resources). ## Made with ❤️ at Callstack React Native Testing Library is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack](https://callstack.com) is a group of React and React Native geeks, contact us at [[email protected]](mailto:[email protected]) if you need any help with these or just want to say hi! Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥 --- Supported and used by [Rally Health](https://www.rallyhealth.com/careers). <!-- badges --> [version-badge]: https://img.shields.io/npm/v/@testing-library/react-native.svg?style=flat-square [package]: https://www.npmjs.com/package/@testing-library/react-native [build-badge]: https://github.com/callstack/react-native-testing-library/actions/workflows/ci.yml/badge.svg [build]: https://github.com/callstack/react-native-testing-library/actions/workflows/ci.yml [coverage-badge]: https://img.shields.io/codecov/c/github/callstack/react-native-testing-library.svg [coverage]: https://codecov.io/github/callstack/react-native-testing-library [downloads-badge]: https://img.shields.io/npm/dm/@testing-library/react-native.svg?style=flat-square [downloads]: http://www.npmtrends.com/@testing-library/react-native [license-badge]: https://img.shields.io/npm/l/@testing-library/react-native.svg [license]: https://opensource.org/licenses/MIT [callstack-badge]: https://callstack.com/images/callstack-badge.svg [callstack]: https://callstack.com/open-source/?utm_source=github.com&utm_medium=referral&utm_campaign=react-native-testing-library&utm_term=readme

Mobile Development Testing & QA
3.4K Github Stars
react-native-builder-bob
Open Source

react-native-builder-bob

<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-builder-bob" align="center"> <picture> <img alt="React Native Builder Bob" src="docs/assets/banner.png"> </picture> </a> [![create-react-native-library][create-react-native-library-version-badge]][create-react-native-library] [![react-native-builder-bob][react-native-builder-bob-version-badge]][react-native-builder-bob] [![MIT License][license-badge]][license] 👷‍♂️ Set of CLIs to scaffold and build React Native libraries for different targets. ## Documentation Documentation is available at [https://oss.callstack.com/react-native-builder-bob/](https://oss.callstack.com/react-native-builder-bob/). ## Development workflow This project uses a monorepo using `yarn`. To setup the project, run `yarn` in the root directory to install the required dependencies. ```sh yarn ``` While developing, you can run watch mode to automatically rebuild the changes: ```sh yarn watch ``` To test the CLI locally, you can point to the appropriate executable: ```sh ../bob/packages/create-react-native-library/bin/create-react-native-library ``` Before sending a pull request, make sure your code passes TypeScript and ESLint. Run the following to verify: ```sh yarn typecheck yarn lint ``` To fix formatting errors, run the following: ```sh yarn lint --fix ``` The documentation for the project is under `docs` directory. To run the documentation locally, run the following: ```sh yarn docs dev ``` ## Publishing Maintainers with write access to the GitHub repo and the npm organization can publish new versions. To publish a new version, first, you need to export a `GH_TOKEN` environment variable as mentioned [here](https://github.com/lerna-lite/lerna-lite/blob/main/packages/version/README.md#remote-client-auth-tokens). Then run: ```sh yarn lerna publish ``` This will automatically bump the version and publish the packages. It'll also publish the changelogs on GitHub for each package. When releasing a pre-release version, we need to: - Update `lerna.json` to set the `preId` (e.g. `next`) and `preDistTag` (e.g. `next`) fields, and potentially the `allowBranch` field. - Run the following command: ```sh yarn lerna publish --conventional-commits --conventional-prerelease --preid next ``` When releasing a stable version, we need to: - Remove the `preId` and `preDistTag` fields from `lerna.json`. - Run the following command: ```sh yarn lerna publish --conventional-commits --conventional-graduate ``` ## Acknowledgments Thanks to the authors of these libraries for inspiration: - [create-react-native-module](https://github.com/brodybits/create-react-native-module) - [react-native-webview](https://github.com/react-native-community/react-native-webview) - [RNNewArchitectureLibraries](https://github.com/react-native-community/RNNewArchitectureLibraries) ## Alternatives Some other tools for building React Native libraries that you may want to check out: - [create-expo-module](https://docs.expo.dev/modules/get-started/) - [create-nitro-module](https://github.com/patrickkabwe/create-nitro-module) - [react-native-module-init](https://github.com/brodybits/react-native-module-init) (Unmaintained) ## LICENSE MIT <!-- badges --> [create-react-native-library-version-badge]: https://img.shields.io/npm/v/create-react-native-library?label=create-react-native-library&style=flat-square [react-native-builder-bob-version-badge]: https://img.shields.io/npm/v/react-native-builder-bob?label=react-native-builder-bob&style=flat-square [create-react-native-library]: https://www.npmjs.com/package/create-react-native-library [react-native-builder-bob]: https://www.npmjs.com/package/react-native-builder-bob [license-badge]: https://img.shields.io/npm/l/react-native-builder-bob.svg?style=flat-square [license]: https://opensource.org/licenses/MIT

Mobile Development Terminal & CLI Tools
3.2K Github Stars
repack
Open Source

repack

<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=repack" align="center"> <img src="https://raw.githubusercontent.com/callstack/repack/HEAD/logo.png" alt="Re.Pack" /> </a> <h3 align="center">A toolkit to build your React Native application with Rspack or Webpack.</h3> <div align="center"> [![mit licence][license-badge]][license] [![npm downloads][npm-downloads-badge]][npm-downloads] [![Chat][chat-badge]][chat] [![PRs Welcome][prs-welcome-badge]][prs-welcome] </div> Re.Pack is a modern bundler for React Native applications, powered by Rspack and Webpack. It serves as a drop-in replacement for Metro, offering enhanced functionality and access to a broad Webpack ecosystem, making it especially useful for implementing microfrontends architecture with Module Federation in your mobile app. ## Documentation The documentation is available at [re-pack.dev](https://re-pack.dev). You can also use the following links to jump to specific topics: - [Quick Start](https://re-pack.dev/docs/getting-started/quick-start) - [About Re.Pack](https://re-pack.dev/docs/getting-started/introduction) - [Configuration](https://re-pack.dev/docs/guides/configuration) - [API documentation](https://re-pack.dev/api/) ## Made with ❤️ at Callstack `@callstack/repack` is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack][callstack-readme-with-love] is a group of React and React Native geeks, contact us at [[email protected]](mailto:[email protected]) if you need any help with these or just want to say hi! Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥 <!-- badges --> [callstack-readme-with-love]: https://callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=repack&utm_term=readme-with-love [license-badge]: https://img.shields.io/npm/l/@callstack/repack?style=for-the-badge [license]: https://github.com/callstack/repack/blob/main/LICENSE [npm-downloads-badge]: https://img.shields.io/npm/dm/@callstack/repack?style=for-the-badge [npm-downloads]: https://www.npmjs.com/package/@callstack/repack [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge [prs-welcome]: ./CONTRIBUTING.md [chat-badge]: https://img.shields.io/discord/426714625279524876.svg?style=for-the-badge [chat]: https://discord.gg/Q4yr2rTWYF

Developer Tools
1.9K Github Stars
react-native-bundle-visualizer
Open Source

react-native-bundle-visualizer

# react-native-bundle-visualizer [![react-native-bundle-visualizer on npm](https://badgen.net/npm/v/react-native-bundle-visualizer)](https://www.npmjs.com/package/react-native-bundle-visualizer) [![react-native-bundle-visualizer downloads](https://badgen.net/npm/dm/react-native-bundle-visualizer)](https://www.npmtrends.com/react-native-bundle-visualizer) [![react-native-bundle-visualizer install size](https://packagephobia.com/badge?p=react-native-bundle-visualizer)](https://packagephobia.com/result?p=react-native-bundle-visualizer) [![CI status](https://github.com/callstack/react-native-bundle-visualizer/actions/workflows/test.yml/badge.svg)](https://github.com/callstack/react-native-bundle-visualizer/actions/workflows/test.yml) See what's inside your react-native bundle 📦 ![bundle-visualizer-animation](./react-native-bundle-visualizer2.gif) Uses the awesome [source-map-explorer](https://github.com/danvk/source-map-explorer) to visualize the output of the [Metro bundler](https://github.com/facebook/metro). ## Purpose Sometimes, importing a single JavaScript library can drastically increase your bundle size. This package helps you to identify such a library, so you can keep the bundle size low and loading times fast. ## Usage Using `npx` is the recommended way to run the visualizer ```sh # React Native 0.72+ npx react-native-bundle-visualizer@latest # or Expo SDK 50+ npx react-native-bundle-visualizer@latest --expo ``` ### Or you can install as a dev-dependency ```sh yarn add --dev react-native-bundle-visualizer # or npm npm install --save-dev react-native-bundle-visualizer ``` To run the local version of visualizer, use the following command: ```sh npx react-native-bundle-visualizer # if installed by yarn or npm yarn run react-native-bundle-visualizer # if installed by Yarn ``` ## Command line arguments All command-line arguments are optional. By default a production build will be created for the `ios` platform. | Option | Description | Example | | ----------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| | `platform` | Platform to build (default is **ios**) | `--platform ios` | | `dev` | Dev or production build (default is **false**) | `--dev false` | | `entry-file` | Entry-file (when omitted tries to auto-resolve it) | `--entry-file ./index.ios.js` | | `bundle-output` | Output bundle-file (default is **tmp**) | `--bundle-output ./myapp.bundle` | | `format` | Output format **html**, **json** or **tsv** (default is **html**) (see [source-map-explorer options][smeo]) | `--format json` | | `only-mapped` | Exclude "unmapped" bytes from the output (default is **false**). This will result in total counts less than the file size. | `--only-mapped` | | `verbose` | Dumps additional output to the console (default is **false**) | `--verbose` | | `reset-cache` | Removes cached react-native files (default is **false**) | `--reset-cache` | | `--expo` | Set this to true/ false based on whether using expo or not. For eg, set `--expo true` when using expo. Not required to pass this for react-native cli. (default is `false`) | `--expo false` | | `--border-checks` | Pass the same flag to the underlying `source-map-explorer` to enable invalid mapping column/line checks. (default is **false**, no check) | `--no-border-checks` or `--border-checks` | [smeo]: https://github.com/danvk/source-map-explorer#options ## Common questions #### 1. What version of React Native and Expo is supported? See the [version compatibility](#version-compatibility) table below. #### 2. What does `[unmapped]` represent? `[unmapped]` is code in a final bundle without mapping to original source code (usually generated by bundlers: Webpack, Metro, Babel) You can [open your source maps online](https://evanw.github.io/source-map-visualization) and check it See example (red borders is unmapped code): ![](https://github.com/user-attachments/assets/9f0d095f-336e-4bda-af67-b0df09d3a5fb) #### 3. What alternatives I can use to inspect my bundle? See the [similar projects](#similar-projects) section below for alternatives to this package. #### 4. `InvalidMappingColumn` error > example: Your source map refers to generated column Infinity on line 2, but the source only contains 2075 column(s) on that line if you faced this error, try to run the visualizer with `--no-border-checks` flag to disable invalid mapping column/line checks. ## Similar projects You can use then following alternatives: - [expo-atlas](https://github.com/expo/atlas) [![expo-atlas downloads](https://badgen.net/npm/dm/expo-atlas)](https://www.npmtrends.com/expo-atlas) [![expo-atlas install size](https://packagephobia.com/badge?p=expo-atlas)](https://packagephobia.com/result?p=expo-atlas) - [expo-atlas-without-expo](https://github.com/v3ron/expo-atlas-without-expo) [![expo-atlas-without-expo downloads](https://badgen.net/npm/dm/expo-atlas-without-expo)](https://www.npmtrends.com/expo-atlas-without-expo) [![expo-atlas-without-expo install size](https://packagephobia.com/badge?p=expo-atlas-without-expo)](https://packagephobia.com/result?p=expo-atlas-without-expo) - [react-native-bundle-visualizer](https://github.com/callstack/react-native-bundle-visualizer) [![react-native-bundle-visualizer downloads](https://badgen.net/npm/dm/react-native-bundle-visualizer)](https://www.npmtrends.com/react-native-bundle-visualizer)[![react-native-bundle-visualizer install size](https://packagephobia.com/badge?p=react-native-bundle-visualizer)](https://packagephobia.com/result?p=react-native-bundle-visualizer) - [react-native-bundle-discovery](https://github.com/retyui/react-native-bundle-discovery) [![react-native-bundle-discovery downloads](https://badgen.net/npm/dm/react-native-bundle-discovery)](https://www.npmtrends.com/react-native-bundle-discovery) [![react-native-bundle-discovery install size](https://packagephobia.com/badge?p=react-native-bundle-discovery)](https://packagephobia.com/result?p=react-native-bundle-discovery) - [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) [![webpack-bundle-analyzer downloads](https://badgen.net/npm/dm/webpack-bundle-analyzer)](https://www.npmtrends.com/webpack-bundle-analyzer)[![webpack-bundle-analyzer install size](https://packagephobia.com/badge?p=webpack-bundle-analyzer)](https://packagephobia.com/result?p=webpack-bundle-analyzer) - [bundle-stats](https://github.com/relative-ci/bundle-stats/tree/master/packages/cli#readme) [![bundle-stats downloads](https://badgen.net/npm/dm/bundle-stats)](https://www.npmtrends.com/bundle-stats)[![bundle-stats install size](https://packagephobia.com/badge?p=bundle-stats)](https://packagephobia.com/result?p=bundle-stats) - [statoscope](https://github.com/statoscope/statoscope) [![@statoscope/cli downloads](https://badgen.net/npm/dm/@statoscope/cli)](https://www.npmtrends.com/@statoscope/cli)[![@statoscope/cli install size](https://packagephobia.com/badge?p=@statoscope/cli)](https://packagephobia.com/result?p=@statoscope/cli) ## Version compatibility | Version | Comments | |------------------------------------------------------------------------------|------------------------------------------------------------------| | 4.x | Compatible with React Native 0.72+ or Expo SDK 50+ (Node.js 20+) | | [3.x](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v3) | Compatible with React-Native CLI bootstrapped projects and Expo SDK 41 or higher. | | [2.x](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v2) | Compatible with React-Native CLI bootstrapped projects and Expo SDK 40 or earlier. | | [1.x](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v1) | Uses the [Haul bundler](https://github.com/callstack/haul) instead instead of the Metro output. | ## License [MIT](./LICENSE.txt)

Developer Tools Testing & QA
1.6K Github Stars
reassure
Open Source

reassure

<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=reassure" align="center"> <picture> <img src="https://github.com/user-attachments/assets/a07e542e-a301-4079-b2cb-f3603f6abb6a" alt="Reassure" /> </picture> </a> <p align="center">Performance testing companion for React and React Native.</p> <p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/callstack/reassure/raw/main/packages/reassure/docs/callstack-x-entain-dark.png"> <img src="https://github.com/callstack/reassure/raw/main/packages/reassure/docs/callstack-x-entain.png" width="327px" alt="Callstack x Entain" /> </picture> </p> <p align="center"> <a href="https://callstack.github.io/reassure/"><b>Read The Docs</b></a> </p> --- - [The problem](#the-problem) - [This solution](#this-solution) - [Installation and setup](#installation-and-setup) - [Writing your first test](#writing-your-first-test) - [Writing async tests](#writing-async-tests) - [Measuring test performance](#measuring-test-performance) - [Write performance testing script](#write-performance-testing-script) - [CI setup](#ci-setup) - [Scaffolding](#scaffolding) - [CI Script (`reassure-tests.sh`)](#ci-script-reassure-testssh) - [Dangerfile](#dangerfile) - [`.gitignore`](#gitignore) - [CI script (`reassure-tests.sh`)](#ci-script-reassure-testssh-1) - [Integration](#integration) - [Updating existing Dangerfile](#updating-existing-dangerfile) - [Creating Dangerfile](#creating-dangerfile) - [Updating the CI configuration file](#updating-the-ci-configuration-file) - [Assessing CI stability](#assessing-ci-stability) - [Analyzing results](#analyzing-results) - [API](#api) - [Measurements](#measurements) - [`measureRenders` function](#measurerenders-function) - [`MeasureRendersOptions` type](#measurerendersoptions-type) - [`measureFunction` function](#measurefunction-function) - [`MeasureFunctionOptions` type](#measurefunctionoptions-type) - [`measureAsyncFunction` function](#measureasyncfunction-function) - [`MeasureAsyncFunctionOptions` type](#measureasyncfunctionoptions-type) - [Configuration](#configuration) - [Default configuration](#default-configuration) - [`configure` function](#configure-function) - [`resetToDefaults` function](#resettodefaults-function) - [Environmental variables](#environmental-variables) - [External References](#external-references) - [Contributing](#contributing) - [License](#license) - [Made with ❤️ at Callstack](#made-with-️-at-callstack) ## The problem You want your React Native app to perform well and fast at all times. As a part of this goal, you profile the app, observe render patterns, apply memoization in the right places, etc. But it's all manual and too easy to unintentionally introduce performance regressions that would only get caught during QA or worse, by your users. ## This solution Reassure allows you to automate React Native app performance regression testing on CI or a local machine. In the same way, you write your integration and unit tests that automatically verify that your app is still _working correctly_, you can write performance tests that verify that your app is still _working performantly_. You can think about it as a React performance testing library. In fact, Reassure is designed to reuse as much of your [React Native Testing Library](https://github.com/callstack/react-native-testing-library) tests and setup as possible. Reassure works by measuring render characteristics – duration and count – of the testing scenario you provide and comparing that to the stable version. It repeats the scenario multiple times to reduce the impact of random variations in render times caused by the runtime environment. Then, it applies statistical analysis to determine whether the code changes are statistically significant. As a result, it generates a human-readable report summarizing the results and displays it on the CI or as a comment to your pull request. In addition to measuring component render times it can also measure execution of regular JavaScript functions. ## Installation and setup To install Reassure, run the following command in your app folder: Using yarn ```sh yarn add --dev reassure ``` Using npm ```sh npm install --save-dev reassure ``` You will also need a working [Jest](https://jestjs.io/docs/getting-started) setup as well as one of either [React Native Testing Library](https://github.com/callstack/react-native-testing-library#installation) or [React Testing Library](https://testing-library.com/docs/react-testing-library/intro). See [Installation guide](https://callstack.github.io/reassure/docs/installation). You can check our example projects: - [React Native (Expo)](https://github.com/callstack/reassure-examples/tree/main/examples/native-expo) - [React Native (CLI)](https://github.com/callstack/reassure-examples/tree/main/examples/native-cli) - [React.js (Next.js)](https://github.com/callstack/reassure-examples/tree/main/examples/web-nextjs) - [React.js (Vite)](https://github.com/callstack/reassure-examples/tree/main/examples/native-expo) Reassure will try to detect which Testing Library you have installed. If both React Native Testing Library and React Testing Library are present, it will warn you about that and give precedence to React Native Testing Library. You can explicitly specify Testing Library to be used by using [`configure`](#configure-function) option: ```ts configure({ testingLibrary: 'react-native' }); // or configure({ testingLibrary: 'react' }); ``` You should set it in your Jest setup file, and you can override it in particular test files if needed. ### Writing your first test Now that the library is installed, you can write your first test scenario in a file with `.perf-test.js`/`.perf-test.tsx` extension: ```ts // ComponentUnderTest.perf-test.tsx import { measureRenders } from 'reassure'; import { ComponentUnderTest } from './ComponentUnderTest'; test('Simple test', async () => { await measureRenders(<ComponentUnderTest />); }); ``` This test will measure render times of `ComponentUnderTest` during mounting and resulting sync effects. > **Note**: Reassure will automatically match test filenames using Jest's `--testMatch` option with value `"**/__perf__/**/*.[jt]s?(x)", "**/*.(perf|perf-test).[jt]s?(x)"`. However, if you want to pass a custom `--testMatch` or `--testRegex` option, you may add it to the `reassure measure` script to pass your own glob. More about `--testMatch` and `--testRegex` in [Jest docs](https://jestjs.io/docs/configuration#testmatch-arraystring) #### Writing async tests If your component contains any async logic or you want to test some interaction, you should pass the `scenario` option: ```ts import { measureRenders } from 'reassure'; import { screen, fireEvent } from '@testing-library/react-native'; import { ComponentUnderTest } from './ComponentUnderTest'; test('Test with scenario', async () => { const scenario = async () => { fireEvent.press(screen.getByText('Go')); await screen.findByText('Done'); }; await measureRenders(<ComponentUnderTest />, { scenario }); }); ``` The body of the `scenario` function is using familiar React Native Testing Library methods. In case of using a version of React Native Testing Library lower than v10.1.0, where [`screen` helper](https://callstack.github.io/react-native-testing-library/docs/api/#screen) is not available, the `scenario` function provides it as its first argument: ```ts import { measureRenders } from 'reassure'; import { fireEvent } from '@testing-library/react-native'; test('Test with scenario', async () => { const scenario = async (screen) => { fireEvent.press(screen.getByText('Go')); await screen.findByText('Done'); }; await measureRenders(<ComponentUnderTest />, { scenario }); }); ``` If your test contains any async changes, you will need to make sure that the scenario waits for these changes to settle, e.g. using `findBy` queries, `waitFor` or `waitForElementToBeRemoved` functions from RNTL. ### Measuring test performance To measure your first test performance, you need to run the following command in the terminal: ```sh yarn reassure ``` This command will run your tests multiple times using Jest, gathering performance statistics and will write them to `.reassure/current.perf` file. To check your setup, check if the output file exists after running the command for the first time. > **Note:** You can add `.reassure/` folder to your `.gitignore` file to avoid accidentally committing your results. Reassure CLI will automatically try to detect your source code branch name and commit hash when you are using Git. You can override these options, e.g. if you are using a different version control system: ```sh yarn reassure --branch [branch name] --commit-hash [commit hash] ``` ### Write performance testing script To detect performance changes, you must measure the performance of two versions of your code current (your modified code) and baseline (your reference point, e.g. `main` branch). To measure performance on two branches, you must switch branches in Git or clone two copies of your repository. We want to automate this task to run on the CI. To do that, you will need to create a performance-testing script. You should save it in your repository, e.g. as `reassure-tests.sh`. A simple version of such script, using a branch-changing approach, is as follows: ```sh #!/usr/bin/env bash set -e BASELINE_BRANCH=${GITHUB_BASE_REF:="main"} # Required for `git switch` on CI git fetch origin # Gather baseline perf measurements git switch "$BASELINE_BRANCH" yarn install yarn reassure --baseline # Gather current perf measurements & compare results git switch --detach - yarn install yarn reassure ``` ## CI setup To make setting up the CI integration and all prerequisites more convenient, we have prepared a CLI command to generate all necessary templates for you to start with. Simply run: ```bash yarn reassure init ``` This will generate the following file structure ``` ├── <ROOT> │ ├── reassure-tests.sh │ ├── dangerfile.ts/js (or dangerfile.reassure.ts/js if dangerfile.ts/js already present) │ └── .gitignore ``` ### Scaffolding #### CI Script (`reassure-tests.sh`) Basic script allowing you to run Reassure on CI. More on the importance and structure of this file in the following section. #### Dangerfile If your project already contains a `dangerfile.ts/js`, the CLI will not override it in any way. Instead, it will generate a `dangerfile.reassure.ts/js` file, allowing you to compare and update your own at your convenience. #### `.gitignore` If the `.gitignore` file is present and no mentions of `reassure` appear, the script will append the `.reassure/` directory to its end. ### CI script (`reassure-tests.sh`) To detect performance changes, you must measure the performance of two versions of your code current (your modified code) and baseline (your reference point, e.g. `main` branch). To measure performance on two branches, you must switch branches in Git or clone two copies of your repository. We want to automate this task to run on the CI. To do that, you will need to create a performance-testing script. You should save it in your repository, e.g. as `reassure-tests.sh`. A simple version of such script, using a branch-changing approach, is as follows: ```sh #!/usr/bin/env bash set -e BASELINE_BRANCH=${GITHUB_BASE_REF:="main"} # Required for `git switch` on CI git fetch origin # Gather baseline perf measurements git switch "$BASELINE_BRANCH" yarn install yarn reassure --baseline # Gather current perf measurements & compare results git switch --detach - yarn install yarn reassure ``` ### Integration As a final setup step, you must configure your CI to run the performance testing script and output the result. For presenting output at the moment, we integrate with Danger JS, which supports all major CI tools. #### Updating existing Dangerfile You will need a working [Danger JS setup](https://danger.systems/js/guides/getting_started.html). Then add Reassure Danger JS plugin to your dangerfile: ```ts // /<project_root>/dangerfile.reassure.ts (generated by the init script) import path from 'path'; import { dangerReassure } from 'reassure'; dangerReassure({ inputFilePath: path.join(__dirname, '.reassure/output.md'), }); ``` #### Creating Dangerfile If you do not have a Dangerfile (`dangerfile.js` or `dangerfile.ts`) yet, you can use the one generated by the `reassure init` script without making any additional changes. It is also in our example file [Dangerfile](https://github.com/callstack/reassure/blob/main/dangerfile.ts). #### Updating the CI configuration file Finally, run both the performance testing script & danger in your CI config: ```yaml - name: Run performance testing script run: ./reassure-tests.sh - name: Run Danger.js run: yarn danger ci env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` You can also check our example [GitHub workflow](https://github.com/callstack/reassure/blob/main/.github/workflows/main.yml). The above example is based on GitHub Actions, but it should be similar to other CI config files and should only serve as a reference in such cases. > **Note**: Your performance test will run much longer than regular integration tests. It's because we run each test scenario multiple times (by default, 10) and repeat that for two branches of your code. Hence, each test will run 20 times by default. That's unless you increase that number even higher. ## Assessing CI stability We measure React component render times with microsecond precision during performance measurements using `React.Profiler`. This means the same code will run faster or slower, depending on the machine. For this reason, baseline & current measurements need to be run on the same machine. Optimally, they should be run one after another. Moreover, your CI agent needs to have stable performance to achieve meaningful results. It does not matter if your agent is fast or slow as long as it is consistent in its performance. That's why the agent should not be used during the performance tests for any other work that might impact measuring render times. To help you assess your machine's stability, you can use the `reassure check-stability` command. It runs performance measurements twice for the current code, so baseline and current measurements refer to the same code. In such a case, the expected changes are 0% (no change). The degree of random performance changes will reflect the stability of your machine. This command can be run both on CI and local machines. Normally, the random changes should be below 5%. Results of 10% and more are considered too high, meaning you should work on tweaking your machine's stability. > **Note**: As a trick of last resort, you can increase the `run` option from the default value of 10 to 20, 50 or even 100 for all or some of your tests, based on the assumption that more test runs will even out measurement fluctuations. That will, however, make your tests run even longer. You can refer to our example [GitHub workflow](https://github.com/callstack/reassure/blob/main/.github/workflows/stability.yml). ## Analyzing results <p align="center"> <img src="https://github.com/callstack/reassure/raw/main/packages/reassure/docs/report-markdown.png" width="920px" alt="Markdown report" /> </p> Looking at the example, you can notice that test scenarios can be assigned to certain categories: - **Significant Changes To Duration** shows test scenarios where the performance change is statistically significant and **should** be looked into as it marks a potential performance loss/improvement - **Meaningless Changes To Duration** shows test scenarios where the performance change is not statistically significant - **Changes To Count** shows test scenarios where the render or execution count did change - **Added Scenarios** shows test scenarios which do not exist in the baseline measurements - **Removed Scenarios** shows test scenarios which do not exist in the current measurements ## API ### Measurements #### `measureRenders` function Custom wrapper for the RNTL `render` function responsible for rendering the passed screen inside a `React.Profiler` component, measuring its performance and writing results to the output file. You can use the optional `options` object that allows customizing aspects of the testing ```ts async function measureRenders( ui: React.ReactElement, options?: MeasureRendersOptions, ): Promise<MeasureResults> { ``` #### `MeasureRendersOptions` type ```ts interface MeasureRendersOptions { runs?: number; warmupRuns?: number; removeOutliers?: boolean; wrapper?: React.ComponentType<{ children: ReactElement }>; scenario?: (view?: RenderResult) => Promise<any>; writeFile?: boolean; beforeEach?: () => Promise<void> | void; afterEach?: () => Promise<void> | void; } ``` - **`runs`**: number of runs per series for the particular test - **`warmupRuns`**: number of additional warmup runs that will be done and discarded before the actual runs (default 1). - **`removeOutliers`**: should remove statistical outlier results (default: `true`) - **`wrapper`**: React component, such as a `Provider`, which the `ui` will be wrapped with. Note: the render duration of the `wrapper` itself is excluded from the results; only the wrapped component is measured. - **`scenario`**: a custom async function, which defines user interaction within the UI by utilising RNTL or RTL functions - **`writeFile`**: should write output to file (default `true`) - **`beforeEach`**: function to execute before each test run. - **`afterEach`**: function to execute after each test run. #### `measureFunction` function Allows you to wrap any synchronous function, measure its execution times and write results to the output file. You can use optional `options` to customize aspects of the testing. Note: the execution count will always be one. ```ts async function measureFunction( fn: () => void, options?: MeasureFunctionOptions ): Promise<MeasureResults> { ``` #### `MeasureFunctionOptions` type ```ts interface MeasureFunctionOptions { runs?: number; warmupRuns?: number; removeOutliers?: boolean; writeFile?: boolean; beforeEach?: () => Promise<void> | void; afterEach?: () => Promise<void> | void; } ``` - **`runs`**: number of runs per series for the particular test - **`warmupRuns`**: number of additional warmup runs that will be done and discarded before the actual runs - **`removeOutliers`**: should remove statistical outlier results (default: `true`) - **`writeFile`**: should write output to file (default `true`) - **`beforeEach`**: function to execute before each test run. - **`afterEach`**: function to execute after each test run. #### `measureAsyncFunction` function Allows you to wrap any **asynchronous** function, measure its execution times and write results to the output file. You can use optional `options` to customize aspects of the testing. Note: the execution count will always be one. > **Note**: Measuring performance of asynchronous functions can be tricky. These functions often depend on external conditions like I/O operations, network requests, or storage access, which introduce unpredictable timing variations in your measurements. For stable and meaningful performance metrics, **always ensure all external calls are properly mocked in your test environment to avoid polluting your performance measurements with uncontrollable factors.** ```ts async function measureAsyncFunction( fn: () => Promise<unknown>, options?: MeasureAsyncFunctionOptions ): Promise<MeasureResults> { ``` #### `MeasureAsyncFunctionOptions` type ```ts interface MeasureAsyncFunctionOptions { runs?: number; warmupRuns?: number; removeOutliers?: boolean; writeFile?: boolean; beforeEach?: () => Promise<void> | void; afterEach?: () => Promise<void> | void; } ``` - **`runs`**: number of runs per series for the particular test - **`warmupRuns`**: number of additional warmup runs that will be done and discarded before the actual runs - **`removeOutliers`**: should remove statistical outlier results (default: `true`) - **`writeFile`**: should write output to file (default `true`) - **`beforeEach`**: function to execute before each test run. - **`afterEach`**: function to execute after each test run. ### Configuration #### Default configuration The default config which will be used by the measuring script. This configuration object can be overridden with the use of the `configure` function. ```ts type Config = { runs?: number; warmupRuns?: number; outputFile?: string; verbose?: boolean; testingLibrary?: | 'react-native' | 'react' | { render: (component: React.ReactElement<any>) => any | Promise<any>; cleanup: () => void | Promise<void>; }; }; ``` ```ts const defaultConfig: Config = { runs: 10, warmupRuns: 1, outputFile: '.reassure/current.perf', verbose: false, testingLibrary: undefined, // Will try auto-detect first RNTL, then RTL }; ``` **`runs`**: the number of repeated runs in a series per test (allows for higher accuracy by aggregating more data). Should be handled with care. - **`warmupRuns`**: the number of additional warmup runs that will be done and discarded before the actual runs. **`outputFile`**: the name of the file the records will be saved to **`verbose`**: make Reassure log more, e.g. for debugging purposes **`testingLibrary`**: where to look for `render` and `cleanup` functions, supported values `'react-native'`, `'react'` or object providing custom `render` and `cleanup` functions #### `configure` function ```ts function configure(customConfig: Partial<Config>): void; ``` The `configure` function can override the default config parameters. #### `resetToDefaults` function ```ts resetToDefaults(): void ``` Reset the current config to the original `defaultConfig` object #### Environmental variables You can use available environmental variables to alter your test runner settings. - `TEST_RUNNER_PATH`: an alternative path for your test runner. Defaults to `'node_modules/.bin/jest'` or on Windows `'node_modules/jest/bin/jest'` - `TEST_RUNNER_ARGS`: a set of arguments fed to the runner. Defaults to `'--runInBand --testMatch "**/__perf__/**/*.[jt]s?(x)", "**/*.(perf|perf-test).[jt]s?(x)"'` Example: ```sh TEST_RUNNER_PATH=myOwnPath/jest/bin yarn reassure ``` ## External References - [The Ultimate Guide to React Native Optimization 2024 Edition](https://www.callstack.com/campaigns/download-the-ultimate-guide-to-react-native-optimization?utm_campaign=RN_Performance&utm_source=readme_reassure) - Mentioned in "Make your app consistently fast" chapter. ## Contributing See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. ## License [MIT](./LICENSE) ## Made with ❤️ at Callstack Reassure is an Open Source project and will always remain free to use. The project has been developed in close partnership with [Entain](https://entaingroup.com/) and was originally their in-house project. Thanks to their willingness to develop the React & React Native ecosystem, we decided to make it Open Source. If you think it's cool, please star it 🌟 Callstack is a group of React and React Native experts. If you need help with these or want to say hi, contact us at [email protected]! Like the project? ⚛️ [Join the Callstack team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥

Testing & QA
1.4K Github Stars
react-native-slider
Open Source

react-native-slider

A pure JavaScript component for react-native

JavaScript Libraries & Components Mobile Development
1.3K Github Stars
react-native-bottom-tabs
Open Source

react-native-bottom-tabs

<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-bottom-tabs" align="center"> <picture> <img alt="React Native Bottom Tabs" src="https://github.com/user-attachments/assets/bbd9632c-4df1-450b-832b-3e03280f3ce7"> </picture> </a> <p align="center"> <strong><a href="https://oss.callstack.com/react-native-bottom-tabs/">React Native Bottom Tabs</a> that use native platform primitives.</strong><br> </p> <div align="center"> [![mit licence](https://img.shields.io/dub/l/vibe-d.svg?style=for-the-badge)](https://github.com/callstack/react-native-bottom-tabs/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/react-native-bottom-tabs?style=for-the-badge)](https://www.npmjs.org/package/react-native-bottom-tabs) [![npm downloads](https://img.shields.io/npm/dt/react-native-bottom-tabs.svg?style=for-the-badge)](https://www.npmjs.org/package/react-native-bottom-tabs) [![npm downloads](https://img.shields.io/npm/dm/react-native-bottom-tabs.svg?style=for-the-badge)](https://www.npmjs.org/package/react-native-bottom-tabs) </div> https://github.com/user-attachments/assets/09e96ac3-827d-4ac0-add0-e7b88ee9197c ## Supported Platforms | Platform | | |:---:|:---:| | **iOS** | <img src="https://github.com/user-attachments/assets/bd737e01-d7be-44f2-a0b6-67664e670933" width="400" /> | | **Android** | <img src="https://github.com/user-attachments/assets/5120a6d0-be92-44cf-a3bf-668944ad9475" width="400" /> | | **iPadOS** | <img src="https://github.com/user-attachments/assets/1504949f-ed36-44cc-9153-373f9e584f44" width="400" /> | | **visionOS** | <img src="https://github.com/user-attachments/assets/7d990950-b9bb-4a42-ab0c-fac975ffd098" width="400" /> | | **tvOS** | <img src="https://github.com/user-attachments/assets/2fe8483d-73f9-408f-9315-100eee7bf2af" width="400" /> | | **macOS** | <img src="https://github.com/user-attachments/assets/758decf4-6e70-4c55-8f2d-c16927f2c56d" width="400" /> | > **Note:** This library uses native platform primitives which are not available on web. For web support, see the [Web Platform Support guide](https://oss.callstack.com/react-native-bottom-tabs/docs/guides/web-platform-support) in the documentation. ## Package Versions | Name | Latest Version | | ---------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------: | | [react-native-bottom-tabs](/packages/react-native-bottom-tabs) | [![badge](https://img.shields.io/npm/v/react-native-bottom-tabs?style=for-the-badge)](https://www.npmjs.com/package/react-native-bottom-tabs) | | [@bottom-tabs/expo-template](/packages/expo-template) | [![badge](https://img.shields.io/npm/v/@bottom-tabs/expo-template.svg?style=for-the-badge)](https://www.npmjs.com/package/@bottom-tabs/expo-template) | | [@bottom-tabs/react-navigation](/packages/react-navigation) | [![badge](https://img.shields.io/npm/v/@bottom-tabs/react-navigation.svg?style=for-the-badge)](https://www.npmjs.com/package/@bottom-tabs/react-navigation) | ## Documentation The full documentation can be found on our [website](https://oss.callstack.com/react-native-bottom-tabs/). ## Contributing See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. ## License MIT --- Made with ❤️ and [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

JavaScript Libraries & Components
1.4K Github Stars
masked-view
Open Source

masked-view

# React Native `MaskedView` [![Build Status][build-badge]][build] [![Version][version-badge]][package] [![MIT License][license-badge]][license] [![Lean Core Badge][lean-core-badge]][lean-core-issue] Provides a React component that renders a masked view. ## Platforms Supported - [x] iOS - [x] Android - [x] Web ## Getting Started ```sh yarn add @react-native-masked-view/masked-view ``` or ```sh npm install --save @react-native-masked-view/masked-view ``` ### Using React Native >= 0.60 Linking the package manually is not required anymore with [Autolinking](https://github.com/react-native-masked-view/cli/blob/master/docs/autolinking.md). Remember to install the pod with: ```sh npx pod-install ``` ### Using React Native < 0.60 You then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project: ```sh react-native link @react-native-masked-view/masked-view ``` ## Usage Import the `MaskedView` component from `@react-native-masked-view/masked-view` and use it like so: ```jsx import React from 'react'; import { Text, View } from 'react-native'; import MaskedView from '@react-native-masked-view/masked-view'; const App = () => { return ( <MaskedView style={{ flex: 1, flexDirection: 'row', height: '100%' }} maskElement={ <View style={{ // Transparent background because mask is based off alpha channel. backgroundColor: 'transparent', flex: 1, justifyContent: 'center', alignItems: 'center', }} > <Text style={{ fontSize: 60, color: 'black', fontWeight: 'bold', }} > Basic Mask </Text> </View> } > {/* Shows behind the mask, you can put anything here, such as an image */} <View style={{ flex: 1, height: '100%', backgroundColor: '#324376' }} /> <View style={{ flex: 1, height: '100%', backgroundColor: '#F5DD90' }} /> <View style={{ flex: 1, height: '100%', backgroundColor: '#F76C5E' }} /> <View style={{ flex: 1, height: '100%', backgroundColor: '#e1e1e1' }} /> </MaskedView> ); } export default App ``` The following image demonstrates that you can put almost anything behind the mask. The three examples shown are masked `<View>`, `<Text>`, and `<Image>`. <div align="center"><img src="img/example.png" width="200"></img></div> ### Web Usage you need to install moden-screenshot package for web usage: ```sh yarn add modern-screenshot ``` ### Props - [View props...](https://github.com/facebook/react-native-website/blob/master/docs/view.md#props) - [`maskElement`](#maskelement) - [`androidRenderingMode`](#androidrenderingmode) ### Reference ### `maskElement` | Type | Required | | ------- | -------- | | element | Yes | ### `androidRenderingMode` By default `hardware` rendering mode will be used for best performance, however if you need to animate your `maskElement` then you’ll need to switch to `software` to get your mask to update. This prop only affects Android. | Type | Required | Default | | ---------------------- | -------- | ---------- | | `software`, `hardware` | No | `hardware` | <!-- badges --> [build-badge]: https://github.com/react-native-masked-view/masked-view/workflows/Build/badge.svg [build]: https://github.com/react-native-masked-view/masked-view/actions [version-badge]: https://img.shields.io/npm/v/@react-native-masked-view/masked-view.svg?style=flat-square [package]: https://www.npmjs.com/package/@react-native-masked-view/masked-view [license-badge]: https://img.shields.io/npm/l/@react-native-masked-view/masked-view.svg?style=flat-square [license]: https://opensource.org/licenses/MIT [lean-core-badge]: https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg?style=flat-square [lean-core-issue]: https://github.com/facebook/react-native/issues/23313

JavaScript Libraries & Components Mobile Development
1.2K Github Stars