{"id":21724829,"url":"https://github.com/melihmucuk/react-native-flat-button","last_synced_at":"2025-04-12T22:53:32.066Z","repository":{"id":57337027,"uuid":"67739033","full_name":"melihmucuk/react-native-flat-button","owner":"melihmucuk","description":"Flat button component for react-native","archived":false,"fork":false,"pushed_at":"2018-05-18T11:29:17.000Z","size":15,"stargazers_count":26,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T22:52:58.759Z","etag":null,"topics":["android","button","flat","ios","react-native"],"latest_commit_sha":null,"homepage":null,"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/melihmucuk.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":"2016-09-08T20:46:15.000Z","updated_at":"2025-02-11T15:48:49.000Z","dependencies_parsed_at":"2022-09-11T12:31:48.826Z","dependency_job_id":null,"html_url":"https://github.com/melihmucuk/react-native-flat-button","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/melihmucuk%2Freact-native-flat-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Freact-native-flat-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Freact-native-flat-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Freact-native-flat-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melihmucuk","download_url":"https://codeload.github.com/melihmucuk/react-native-flat-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643043,"owners_count":21138353,"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":["android","button","flat","ios","react-native"],"created_at":"2024-11-26T03:13:38.305Z","updated_at":"2025-04-12T22:53:32.041Z","avatar_url":"https://github.com/melihmucuk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-flat-button\n\n[![npm version](https://badge.fury.io/js/react-native-flat-button.svg)](https://badge.fury.io/js/react-native-flat-button)\n\nFlat button component for react-native\n\n![react-native flat button](http://i.giphy.com/3o6ZtfDAQbom8925J6.gif)\n\n## Installation\n`npm i react-native-flat-button --save`\n\n## API\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| ``type`` | ``string``(required) | - | Type of button. Use predefined types: ``'primary'``, ``'neutral'``, ``'warn'``, ``'positive'``, ``'negative'``, ``'info'`` or use ``'custom'`` |\n| ``backgroundColor`` | ``string`` | ``'#34495e'`` | Sets button's background color. |\n| ``borderColor`` | ``string`` | ``'#2c3e50'`` | Sets button's border color. |\n| ``borderRadius`` | ``number`` | ``8``| Sets button's border radius. |\n| ``shadowHeight`` | ``number`` | ``4`` | Sets button's border shadow. |\n| ``borderLeftWidth`` | ``number`` | ``0.5`` | Sets button's border left shadow. |\n| ``borderRightWidth`` | ``number`` | ``0.5`` | Sets button's border right shadow. |\n| ``activeOpacity`` | ``number`` | ``0.9`` | Sets button's onpressing transparency. (It should be between 0 to 1) |\n| ``containerStyle`` | ``View.propTypes.style``| ``{justifyContent: 'center',alignItems: 'center'}`` | Sets button's style (Same as ``TouchableOpacity``) |\n| ``contentStyle`` | ``Text.propTypes.style`` | ``{color: 'white',fontSize: 18,fontWeight: 'bold'}`` | Sets button's text style (Same as ``Text``) |\n\n## Example\n\n```javascript\nimport React, { Component } from 'react'\nimport {\n  Alert,\n  AppRegistry,\n  StyleSheet,\n  Text,\n  View,\n} from 'react-native'\n\nimport Button from 'react-native-flat-button'\n\nclass Example extends Component {\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cText style={{ fontSize: 20, fontWeight: 'bold' }}\u003e\n          Pre-Defined Buttons\n        \u003c/Text\u003e\n\n        \u003cButton\n          type=\"primary\"\n          onPress={() =\u003e Alert.alert('Primary Button')}\n          containerStyle={styles.buttonContainer}\n        \u003e\n          Primary Button\n        \u003c/Button\u003e\n\n        \u003cButton\n          type=\"positive\"\n          onPress={() =\u003e Alert.alert('Positive Button')}\n          containerStyle={styles.buttonContainer}\n        \u003e\n          Positive Button\n        \u003c/Button\u003e\n\n        \u003cButton\n          type=\"negative\"\n          onPress={() =\u003e Alert.alert('Negative Button')}\n          containerStyle={styles.buttonContainer}\n        \u003e\n          Negative Button\n        \u003c/Button\u003e\n\n        \u003cButton\n          type=\"neutral\"\n          onPress={() =\u003e Alert.alert('Neutral Button')}\n          containerStyle={styles.buttonContainer}\n        \u003e\n          Neutral Button\n        \u003c/Button\u003e\n\n        \u003cButton\n          type=\"warn\"\n          onPress={() =\u003e Alert.alert('Warn Button')}\n          containerStyle={styles.buttonContainer}\n        \u003e\n          Warn Button\n        \u003c/Button\u003e\n\n        \u003cButton\n          type=\"info\"\n          onPress={() =\u003e Alert.alert('Info Button')}\n          containerStyle={styles.buttonContainer}\n        \u003e\n          Info Button\n        \u003c/Button\u003e\n\n        \u003cText style={{ fontSize: 20, fontWeight: 'bold' }}\u003e\n          Custom Buttons\n        \u003c/Text\u003e\n\n        \u003cButton\n          type=\"custom\"\n          onPress={() =\u003e Alert.alert('Custom Button #1')}\n          backgroundColor={\"#1abc9c\"}\n          borderColor={\"#16a085\"}\n          borderRadius={10}\n          shadowHeight={5}\n          containerStyle={styles.buttonContainer}\n          contentStyle={styles.content}\n        \u003e\n          Custom Button\n        \u003c/Button\u003e\n\n        \u003cButton\n          type=\"custom\"\n          onPress={() =\u003e Alert.alert('Custom Button #2')}\n          backgroundColor={\"#9b59b6\"}\n          borderColor={\"#8e44ad\"}\n          borderRadius={6}\n          shadowHeight={8}\n          activeOpacity={0.5}\n          containerStyle={styles.buttonContainer}\n          contentStyle={{ fontSize: 22, fontWeight: '900' }}\n        \u003e\n          Custom Button\n        \u003c/Button\u003e\n      \u003c/View\u003e\n    )\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#F5FCFF',\n  },\n  buttonContainer: {\n    width: 200,\n    height: 50,\n    marginVertical: 5\n  },\n  content:{\n    fontSize: 22\n  }\n})\n\nAppRegistry.registerComponent('Example', () =\u003e Example)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelihmucuk%2Freact-native-flat-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelihmucuk%2Freact-native-flat-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelihmucuk%2Freact-native-flat-button/lists"}