From f8d5c154052f9a7c56cb863d00fc1e4eb806ce29 Mon Sep 17 00:00:00 2001 From: Calvin Chan Date: Mon, 5 Dec 2016 11:08:00 -0800 Subject: [PATCH] [add] Button component --- README.md | 1 + docs/components/Button.md | 39 +++++++++ examples/components/Button/ButtonExample.js | 80 +++++++++++++++++++ src/components/Button/__tests__/index-test.js | 5 ++ src/components/Button/index.js | 66 +++++++++++++++ src/index.js | 2 + 6 files changed, 193 insertions(+) create mode 100644 docs/components/Button.md create mode 100644 examples/components/Button/ButtonExample.js create mode 100644 src/components/Button/__tests__/index-test.js create mode 100644 src/components/Button/index.js diff --git a/README.md b/README.md index b73023d3..8e287439 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Exported modules: * Components * [`ActivityIndicator`](docs/components/ActivityIndicator.md) + * [`Button`](docs/components/Button.md) * [`Image`](docs/components/Image.md) * [`ListView`](docs/components/ListView.md) * [`ProgressBar`](docs/components/ProgressBar.md) diff --git a/docs/components/Button.md b/docs/components/Button.md new file mode 100644 index 00000000..df92c51e --- /dev/null +++ b/docs/components/Button.md @@ -0,0 +1,39 @@ +# Button + +A basic button component. Supports a minimal level of customization. You can +build your own custom button using `TouchableOpacity` or +`TouchableNativeFeedback`. + +## Props + +**accessibilityLabel**: string + +Defines the text available to assistive technologies upon interaction with the +element. (This is implemented using `aria-label`.) + +**color**: string + +Background color of the button. + +**disabled**: bool = false + +If true, disable all interactions for this component + +**onPress**: function + +This function is called on press. + +**title**: string + +Text to display inside the button. + +## Examples + +```js +