mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-17 20:39:14 +00:00
7705f521c8
* Change 'accessible' to align with React Native. * Add support for 'importantForAccessibility'. * Stop event propagation for keyboard-activated Touchables (nested Touchables now respond the same as when touch-activated). * Fix whitespace layout of nested Text elements. * Use 'div' for Text to improve TalkBack grouping. * Rewrite accessibility docs. Close #382 Fix #408
44 lines
778 B
Markdown
44 lines
778 B
Markdown
# 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
|
|
|
|
Overrides the text that's read by a screen reader when the user interacts
|
|
with the element.
|
|
|
|
**color**: ?string
|
|
|
|
Background color of the button.
|
|
|
|
**disabled**: ?boolean
|
|
|
|
If `true`, disable all interactions for this element.
|
|
|
|
**onPress**: function
|
|
|
|
This function is called on press.
|
|
|
|
testID: ?string
|
|
|
|
Used to locate this view in end-to-end tests.
|
|
|
|
**title**: string
|
|
|
|
Text to display inside the button.
|
|
|
|
## Examples
|
|
|
|
```js
|
|
<Button
|
|
accessibilityLabel="Learn more about this purple button"
|
|
color="#841584"
|
|
onPress={onPressLearnMore}
|
|
title="Learn More"
|
|
/>
|
|
```
|