diff --git a/README.md b/README.md index f797773b..f5c0ca71 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ touch handling to the Web. [Read more](#why). Browse the UI Explorer to see React Native [examples running on Web](https://necolas.github.io/react-native-web/storybook/). Or try it out -online with [React Native for Web: Playground](http://codepen.io/necolas/pen/PZzwBR). +online with [React Native for Web: Playground](https://www.webpackbin.com/bins/-KgucwxRbn7HRU-V-3Bc). ## Quick start @@ -144,7 +144,6 @@ AppRegistry.runApplication('MyApp', { rootTag: document.getElementById('react-ro * [react-native-web-player](https://github.com/dabbott/react-native-web-player) * [reactxp](https://github.com/microsoft/reactxp) * [react-web](https://github.com/taobaofed/react-web) -* [rhinos-app](https://github.com/rhinos-app/rhinos-app-dev) ## License diff --git a/docs/components/ActivityIndicator.md b/docs/components/ActivityIndicator.md index f8f88272..eac4425b 100644 --- a/docs/components/ActivityIndicator.md +++ b/docs/components/ActivityIndicator.md @@ -4,19 +4,19 @@ [...View props](./View.md) -**animating**: bool = true +**animating**: boolean = true Whether to show the indicator or hide it. -**color**: string = '#1976D2' +**color**: ?color = '#1976D2' The foreground color of the spinner. -**hidesWhenStopped**: bool = true +**hidesWhenStopped**: ?boolean = true Whether the indicator should hide when not animating. -**size**: oneOf('small, 'large') | number = 'small' +**size**: ?enum('small, 'large') | number = 'small' Size of the indicator. Small has a height of `20`, large has a height of `36`. diff --git a/docs/components/Button.md b/docs/components/Button.md index df92c51e..93ffc47d 100644 --- a/docs/components/Button.md +++ b/docs/components/Button.md @@ -6,23 +6,27 @@ build your own custom button using `TouchableOpacity` or ## Props -**accessibilityLabel**: string +**accessibilityLabel**: ?string -Defines the text available to assistive technologies upon interaction with the -element. (This is implemented using `aria-label`.) +Overrides the text that's read by a screen reader when the user interacts +with the element. -**color**: string +**color**: ?string Background color of the button. -**disabled**: bool = false +**disabled**: ?boolean -If true, disable all interactions for this component +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. diff --git a/docs/components/Image.md b/docs/components/Image.md index 02ab318d..450d15d5 100644 --- a/docs/components/Image.md +++ b/docs/components/Image.md @@ -9,65 +9,66 @@ Unsupported React Native props: ## Props -**accessibilityLabel**: string +**accessibilityLabel**: ?string The text that's read by a screenreader when someone interacts with the image. -**accessible**: bool +**accessible**: ?boolean -When `false`, the view is hidden from screenreaders. Default: `true`. +When `true`, indicates the image is an accessibility element. -**children**: any +**children**: ?any Content to display over the image. -**defaultSource**: { uri: string } +**defaultSource**: ?object -An image to display as a placeholder while downloading the final image off the network. +An image to display as a placeholder while downloading the final image off the +network. `{ uri: string, width, height }` -**onError**: function +**onError**: ?function Invoked on load error with `{nativeEvent: {error}}`. -**onLayout**: function +**onLayout**: ?function Invoked on mount and layout changes with `{ nativeEvent: { layout: { x, y, width, height } } }`, where `x` and `y` are the offsets from the parent node. -**onLoad**: function +**onLoad**: ?function Invoked when load completes successfully. -**onLoadEnd**: function +**onLoadEnd**: ?function Invoked when load either succeeds or fails, -**onLoadStart**: function +**onLoadStart**: ?function Invoked on load start. -**resizeMode**: oneOf('center', 'contain', 'cover', 'none', 'repeat', 'stretch') = 'cover' +**resizeMode**: ?enum('center', 'contain', 'cover', 'none', 'repeat', 'stretch') = 'cover' Determines how to resize the image when the frame doesn't match the raw image dimensions. -**source**: { uri: string } +**source**: ?object `uri` is a string representing the resource identifier for the image, which -could be an http address or a base64 encoded image. +could be an http address or a base64 encoded image. `{ uri: string, width, height }` -**style**: style +**style**: ?style + ...[View#style](./View.md) + `resizeMode` -**testID**: string +**testID**: ?string Used to locate a view in end-to-end tests. ## Properties -static **resizeMode**: Object +static **resizeMode**: object Example usage: diff --git a/docs/components/ProgressBar.md b/docs/components/ProgressBar.md index 80064773..4334e3d0 100644 --- a/docs/components/ProgressBar.md +++ b/docs/components/ProgressBar.md @@ -6,18 +6,22 @@ Display an activity progress bar. [...View props](./View.md) -**color**: string = '#1976D2' +**color**: ?string = '#1976D2' Color of the progress bar. -**indeterminate**: bool = true +**indeterminate**: ?boolean = true Whether the progress bar will show indeterminate progress. -**progress**: number +**progress**: ?number The progress value (between 0 and 1). -(web) **trackColor**: string = 'transparent' +**testID**: ?string + +Used to locate this view in end-to-end tests. + +(web) **trackColor**: ?string = 'transparent' Color of the track bar. diff --git a/docs/components/ScrollView.md b/docs/components/ScrollView.md index e152accd..5b6d0c82 100644 --- a/docs/components/ScrollView.md +++ b/docs/components/ScrollView.md @@ -9,17 +9,17 @@ view directly (discouraged) or make sure all parent views have bounded height [...View props](./View.md) -**contentContainerStyle**: style +**contentContainerStyle**: ?style These styles will be applied to the scroll view content container which wraps all of the child views. -**horizontal**: bool = false +**horizontal**: ?boolean = false -When true, the scroll view's children are arranged horizontally in a row +When `true`, the scroll view's children are arranged horizontally in a row instead of vertically in a column. -**keyboardDismissMode**: oneOf('none', 'on-drag') = 'none' +**keyboardDismissMode**: ?enum('none', 'on-drag') = 'none' Determines whether the keyboard gets dismissed in response to a scroll drag. @@ -27,13 +27,13 @@ Determines whether the keyboard gets dismissed in response to a scroll drag. * `on-drag`, the keyboard is dismissed when a drag begins. * `interactive` (not supported on web; same as `none`) -**onContentSizeChange**: function +**onContentSizeChange**: ?function Called when scrollable content view of the `ScrollView` changes. It's implemented using the `onLayout` handler attached to the content container which this `ScrollView` renders. -**onScroll**: function +**onScroll**: ?function Fires at most once per frame during scrolling. The frequency of the events can be contolled using the `scrollEventThrottle` prop. @@ -50,18 +50,18 @@ Invoked on scroll with the following event: } ``` -**refreshControl**: element +**refreshControl**: ?element TODO A [RefreshControl](../RefreshControl) component, used to provide pull-to-refresh functionality for the `ScrollView`. -**scrollEnabled**: bool = true +**scrollEnabled**: ?boolean = true When false, the content does not scroll. -**scrollEventThrottle**: number = 0 +**scrollEventThrottle**: ?number = 0 This controls how often the scroll event will be fired while scrolling (as a time interval in ms). A lower number yields better accuracy for code that is diff --git a/docs/components/Switch.md b/docs/components/Switch.md index 225610a3..3fd51f5b 100644 --- a/docs/components/Switch.md +++ b/docs/components/Switch.md @@ -9,31 +9,31 @@ supplied `value` prop instead of the expected result of any user actions. [...View props](./View.md) -**disabled**: bool = false +**disabled**: ?boolean = false If `true` the user won't be able to interact with the switch. -**onValueChange**: func +**onValueChange**: ?function Invoked with the new value when the value changes. -**value**: bool = false +**value**: ?boolean = false The value of the switch. If `true` the switch will be turned on. -(web) **activeThumbColor**: color = #009688 +(web) **activeThumbColor**: ?color = #009688 The color of the thumb grip when the switch is turned on. -(web) **activeTrackColor**: color = #A3D3CF +(web) **activeTrackColor**: ?color = #A3D3CF The color of the track when the switch is turned on. -(web) **thumbColor**: color = #FAFAFA +(web) **thumbColor**: ?color = #FAFAFA The color of the thumb grip when the switch is turned off. -(web) **trackColor**: color = #939393 +(web) **trackColor**: ?color = #939393 The color of the track when the switch is turned off. diff --git a/docs/components/Text.md b/docs/components/Text.md index fa8e2222..b0b2a14a 100644 --- a/docs/components/Text.md +++ b/docs/components/Text.md @@ -16,49 +16,62 @@ Unsupported React Native props: NOTE: `Text` will transfer all other props to the rendered HTML element. -(web) **accessibilityLabel**: string +(web) **accessibilityLabel**: ?string -Defines the text available to assistive technologies upon interaction with the -element. (This is implemented using `aria-label`.) +Overrides the text that's read by a screen reader when the user interacts +with the element. (This is implemented using `aria-label`.) -(web) **accessibilityRole**: oneOf(roles) +See the [Accessibility guide](../guides/accessibility) for more information. + +(web) **accessibilityRole**: ?oneOf(roles) Allows assistive technologies to present and support interaction with the view in a manner that is consistent with user expectations for similar views of that type. For example, marking a touchable view with an `accessibilityRole` of `button`. (This is implemented using [ARIA roles](http://www.w3.org/TR/wai-aria/roles#role_definitions)). -Note: Avoid changing `accessibilityRole` values over time or after user -actions. Generally, accessibility APIs do not provide a means of notifying -assistive technologies of a `role` value change. +See the [Accessibility guide](../guides/accessibility) for more information. -**accessible**: bool = true +**accessible**: ?boolean -When `false`, the text is hidden from assistive technologies. (This is -implemented using `aria-hidden`.) +When `true`, indicates that the view is an accessibility element (i.e., +focusable) and groups its child content. By default, all the touchable elements +and elements with `accessibilityRole` of `button` and `link` are accessible. +(This is implemented using `tabindex`.) -**children**: any +See the [Accessibility guide](../guides/accessibility) for more information. + +**children**: ?any Child content. -**numberOfLines**: number +**importantForAccessibility**: ?enum('auto', 'no-hide-descendants', 'yes') + +A value of `no` will remove the element from the tab flow. + +A value of `no-hide-descendants` will hide the element and its children from +assistive technologies. (This is implemented using `aria-hidden`.) + +See the [Accessibility guide](../guides/accessibility) for more information. + +**numberOfLines**: ?number Truncates the text with an ellipsis after this many lines. Currently only supports `1`. -**onLayout**: function +**onLayout**: ?function Invoked on mount and layout changes with `{ nativeEvent: { layout: { x, y, width, height } } }`, where `x` and `y` are the offsets from the parent node. -**onPress**: function +**onPress**: ?function This function is called on press. -**selectable**: bool = true +**selectable**: ?boolean -Lets the user select the text. +When `false`, the text is not selectable. -**style**: style +**style**: ?style + ...[View#style](View.md) + `color` @@ -85,7 +98,7 @@ Lets the user select the text. ‡ web only. -**testID**: string +**testID**: ?string Used to locate this view in end-to-end tests. diff --git a/docs/components/TextInput.md b/docs/components/TextInput.md index e23320b9..4cf96db8 100644 --- a/docs/components/TextInput.md +++ b/docs/components/TextInput.md @@ -18,7 +18,7 @@ Unsupported React Native props: [...View props](./View.md) -**autoCapitalize**: oneOf('characters', 'none', 'sentences', 'words') = 'sentences' +**autoCapitalize**: ?enum('characters', 'none', 'sentences', 'words') = 'sentences' Automatically capitalize certain characters (only available in Chrome and iOS Safari). @@ -27,21 +27,21 @@ Automatically capitalize certain characters (only available in Chrome and iOS Sa * `sentences`: Automatically capitalize the first letter of sentences. * `words`: Automatically capitalize the first letter of words. -(web) **autoComplete**: string +(web) **autoComplete**: ?string Indicates whether the value of the control can be automatically completed by the browser. [Accepted values](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). -**autoCorrect**: bool = true +**autoCorrect**: ?boolean = true Automatically correct spelling mistakes (only available in iOS Safari). -**autoFocus**: bool = false +**autoFocus**: ?boolean = false If `true`, focuses the input on `componentDidMount`. Only the first form element in a document with `autofocus` is focused. -**blurOnSubmit**: bool +**blurOnSubmit**: ?boolean If `true`, the text field will blur when submitted. The default value is `true` for single-line fields and `false` for multiline fields. Note, for multiline @@ -49,104 +49,104 @@ fields setting `blurOnSubmit` to `true` means that pressing return will blur the field and trigger the `onSubmitEditing` event instead of inserting a newline into the field. -**clearTextOnFocus**: bool = false +**clearTextOnFocus**: ?boolean = false If `true`, clears the text field automatically when focused. -**defaultValue**: string +**defaultValue**: ?string Provides an initial value that will change when the user starts typing. Useful for simple use-cases where you don't want to deal with listening to events and updating the `value` prop to keep the controlled state in sync. -**editable**: bool = true +**editable**: ?boolean = true If `false`, text is not editable (i.e., read-only). -**keyboardType**: oneOf('default', 'email-address', 'numeric', 'phone-pad', 'search', 'url', 'web-search') = 'default' +**keyboardType**: enum('default', 'email-address', 'numeric', 'phone-pad', 'search', 'url', 'web-search') = 'default' Determines which keyboard to open. (NOTE: Safari iOS requires an ancestral `