{"id":19499716,"url":"https://github.com/apsl/react-native-button","last_synced_at":"2025-05-15T22:11:58.861Z","repository":{"id":44174437,"uuid":"41495065","full_name":"APSL/react-native-button","owner":"APSL","description":"A React Native button component customizable via props","archived":false,"fork":false,"pushed_at":"2022-12-03T15:36:22.000Z","size":965,"stargazers_count":746,"open_issues_count":33,"forks_count":122,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-05-15T22:11:28.286Z","etag":null,"topics":["button","react","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/APSL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-27T15:28:01.000Z","updated_at":"2025-02-26T21:30:56.000Z","dependencies_parsed_at":"2023-01-23T04:46:26.516Z","dependency_job_id":null,"html_url":"https://github.com/APSL/react-native-button","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/APSL","download_url":"https://codeload.github.com/APSL/react-native-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254430335,"owners_count":22069909,"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":["button","react","react-native"],"created_at":"2024-11-10T22:06:06.360Z","updated_at":"2025-05-15T22:11:53.846Z","avatar_url":"https://github.com/APSL.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apsl-react-native-button\n\u003cimg src=\"https://travis-ci.org/APSL/react-native-button.svg?branch=master\" /\u003e\n\u003cimg src=\"https://img.shields.io/badge/coverage-82%25-green.svg\" /\u003e\n\u003cimg src=\"https://img.shields.io/npm/dm/apsl-react-native-button.svg\" /\u003e\n\nA React Native button component customizable via ``style`` props.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/APSL/react-native-button/button.png\" alt=\"Button component screenshot\" width=\"400\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/APSL/react-native-button/and.png\" alt=\"Android Button component screenshot\" width=\"400\"\u003e\n\u003c/p\u003e\n\nRenders a ``TouchableOpacity`` under iOS and a ``TouchableNativeFeedback`` under Android.\n\n## Install\n`apsl-react-native-button\u003e=2.6.0` needs React Native 0.28 or higher.\n`apsl-react-native-button\u003e=2.5.0` needs React Native 0.25 or higher.\n`apsl-react-native-button\u003c=2.4.2` needs React Native 0.16 or higher.\n\nInstall the package:\n\n```bash\n$ npm i apsl-react-native-button --save\n```\n\nImport the ``Button`` component:\n\n```javascript\nimport Button from 'apsl-react-native-button'\n```\n\n## Usage\n\nProvide ``TouchableWithoutFeedback``' props to the component (including ``style``),\n``textStyle``'s ``StyleSheet`` to customize the inner text and a children node\nto render. You can also provide the ``isLoading`` prop that will dim the button\nand disable it to prevent accidental taps.\n\n```javascript\n\u003cButton style={{backgroundColor: 'red'}} textStyle={{fontSize: 18}}\u003e\n  Hello!\n\u003c/Button\u003e\n```\n\nYou can also provide a `\u003cButton\u003e` element with nested children that are not strings\nor `\u003cText\u003e` elements as long as they are valid React elements or numbers. This helps\nif your project is using another library that provides easy icon integration\nutilizing the `\u003ci\u003e` tag, for instance, as well as various other cases where you are\ncreating visually complex buttons. You may omit the `textStyle` property and apply\nyour own styles to your child elements as you see fit. Multiple children are allowed.\n\n```javascript\n\u003cButton style={{backgroundColor: 'blue'}}\u003e\n  \u003cView style={styles.nestedViewStyle}\u003e\n    \u003cText style={styles.nestedTextStyle}\u003eNested views!\u003c/Text\u003e\n  \u003c/View\u003e\n\u003c/Button\u003e\n```\n\n## API\n\n| Prop | Type | Description |\n|------|------|-------------|\n| ``onPress`` | ``func`` | Function to execute when the ``onPress`` event is triggered. |\n| ``onPressIn`` | ``func`` | Function to execute when the ``onPressIn`` event is triggered. |\n| ``onPressOut`` | ``func`` | Function to execute when the ``onPressOut`` event is triggered. |\n| ``onLongPress`` | ``func`` | Function to execute when the ``onLongPress`` event is triggered. |\n| ``textStyle`` | ``TextStylePropTypes`` | The StyleSheet to apply to the inner button text. |\n| ``disabledStyle`` | ``TextStylePropTypes`` | The StyleSheet to apply when disabled. |\n| ``children`` | ``string``, ``number``, ``React.Element``,or ``array`` | The child nodes to render inside the button. If child is ``string`` or ``number``, it will be rendered inside of a ``\u003cText\u003e`` element with ``textStyle`` applied if present. Multiple children are allowed (``array``).|\n| ``isLoading`` | ``bool`` | Renders an inactive state dimmed button with a spinner if ``true``. |\n| ``isDisabled`` | ``bool`` | Renders an inactive state dimmed button if ``true``. |\n| ``activeOpacity`` | ``Number`` | The button onpressing transparency (Usually with a point value between 0 and 1). |\n| ``activityIndicatorColor`` | ``string`` | Sets the button of the ``ActivityIndicatorIOS`` or ``ProgressBarAndroid`` in the loading state. |\n| ``background`` | ``TouchableNativeFeedback.propTypes.background`` | **Android only**. The background prop of ``TouchableNativeFeedback``. |\nCheck the included example for more options.\n\n## Similar projects\n\n[James Ide](https://github.com/ide/)'s ``react-native-button`` https://github.com/ide/react-native-button/\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsl%2Freact-native-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapsl%2Freact-native-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsl%2Freact-native-button/lists"}