{"id":3983,"url":"https://github.com/mfrachet/action-sheet-rn","last_synced_at":"2025-04-13T13:30:55.816Z","repository":{"id":35022901,"uuid":"197595150","full_name":"mfrachet/action-sheet-rn","owner":"mfrachet","description":"Probably the most declarative API for ActionSheets in React Native","archived":false,"fork":false,"pushed_at":"2023-01-04T04:45:27.000Z","size":4717,"stargazers_count":38,"open_issues_count":31,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T17:29:17.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mfrachet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-18T13:44:12.000Z","updated_at":"2024-10-10T10:58:10.000Z","dependencies_parsed_at":"2023-01-15T12:15:13.353Z","dependency_job_id":null,"html_url":"https://github.com/mfrachet/action-sheet-rn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfrachet%2Faction-sheet-rn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfrachet%2Faction-sheet-rn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfrachet%2Faction-sheet-rn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfrachet%2Faction-sheet-rn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfrachet","download_url":"https://codeload.github.com/mfrachet/action-sheet-rn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248720977,"owners_count":21151020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:57.607Z","updated_at":"2025-04-13T13:30:54.666Z","avatar_url":"https://github.com/mfrachet.png","language":"TypeScript","funding_links":[],"categories":["Components"],"sub_categories":["UI"],"readme":"[![Build Status](https://travis-ci.org/mfrachet/action-sheet-rn.svg?branch=master)](https://travis-ci.org/mfrachet/action-sheet-rn)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nProbably the most declarative API for ActionSheets in React Native\n\n![Image of the action sheets in action](./docs/as.gif)\n\n[Here's a running snack of the lib :)](https://snack.expo.io/@mfrachet/great-tortillas)\n\n# Usage\n\n## Installation\n\n```javascript\n$ yarn add action-sheet-rn\n```\n\n## In your code\n\n```jsx\nimport { ActionSheet, SheetItem, SheetDivider } from \"action-sheet-rn\";\n\n// Icons can be defined as:\n// const ShareIcon = \u003cImage source={require(\"./share.png\")} /\u003e\n// const CreateIcon = \u003cImage source={require(\"./create.png\")} /\u003e\n// const RemoveIcon = \u003cImage source={require(\"./remove.png\")} /\u003e\n// const LocateIcon = \u003cImage source={require(\"./locate.png\")} /\u003e\n// const ShareIcon = \u003cImage source={require(\"./remove.png\")} /\u003e\n\nconst App = ({ isVisible }) =\u003e\n  isVisible \u0026\u0026 (\n    \u003cActionSheet title=\"What do you want to do?\"\u003e\n      \u003cSheetItem Icon={ShareIcon} onPress={handleShare}\u003e\n        Share\n      \u003c/SheetItem\u003e\n\n      \u003cSheetItem Icon={CreateIcon} onPress={handleCreate}\u003e\n        Create\n      \u003c/SheetItem\u003e\n\n      \u003cSheetItem Icon={RemoveIcon} type=\"remove\" onPress={handleRemove}\u003e\n        Remove\n      \u003c/SheetItem\u003e\n\n      \u003cSheetDivider /\u003e\n\n      \u003cSheetItem Icon={LocateIcon} onPress={handleLocate}\u003e\n        Locate\n      \u003c/SheetItem\u003e\n\n      \u003cSheetItem type=\"cancel\" onPress={handleCancel}\u003e\n        Cancel\n      \u003c/SheetItem\u003e\n    \u003c/ActionSheet\u003e\n  );\n```\n\n## How it works?\n\n### iOS\n\nIt displays a native `ActionSheet` using [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios).\n\nOn a `SheetItem`, you can specify a `type` of value `cancel | remove` that will allow to customize its style (positionning the cancel button to the bottom and adding the red style of the remove one).\n\n_The `Icon` prop has no effect on the iOS Action Sheet. It's only relevant for Android_\n\n### Android\n\nIt displays a custom and JavaScript implementation of a [Modal Bottom Sheet from the Material Design Spec](https://material.io/design/components/sheets-bottom.html#modal-bottom-sheet). For now, it's not implemented 100%, but I really hope it will (missing the gesture handling + the number of visible items etc..)\n\nOn Android, the `SheetItem` with the `cancel` type won't be visible. Instead, the lib will handle the click on the opaque zone as a cancellation (only when the `type=\"cancel\"` is provided to keep consistency between iOS and Android).\n\nYou can also pass an `Icon` props to the `SheetItem` so that it adds a little Icon on the left, always following the spec concerning size / margins.\n\n_The `remove` type as no specific effects on Android._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfrachet%2Faction-sheet-rn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfrachet%2Faction-sheet-rn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfrachet%2Faction-sheet-rn/lists"}