mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-24 23:25:40 +00:00
Docs: minor update
This commit is contained in:
+21
-13
@@ -3,51 +3,59 @@
|
|||||||
An accessibile image component with support for image resizing, default image,
|
An accessibile image component with support for image resizing, default image,
|
||||||
and child content.
|
and child content.
|
||||||
|
|
||||||
|
Unsupported React Native props:
|
||||||
|
`capInsets` (ios),
|
||||||
|
`onProgress` (ios)
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
**accessibilityLabel** string
|
**accessibilityLabel**: string
|
||||||
|
|
||||||
The text that's read by a screenreader when someone interacts with the image.
|
The text that's read by a screenreader when someone interacts with the image.
|
||||||
|
|
||||||
**accessible** bool
|
**accessible**: bool
|
||||||
|
|
||||||
When `false`, the view is hidden from screenreaders. Default: `true`.
|
When `false`, the view is hidden from screenreaders. Default: `true`.
|
||||||
|
|
||||||
**children** any
|
**children**: any
|
||||||
|
|
||||||
Content to display over the image.
|
Content to display over the image.
|
||||||
|
|
||||||
**defaultSource** { uri: string }
|
**defaultSource**: { uri: string }
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
**onError** function
|
**onError**: function
|
||||||
|
|
||||||
Invoked on load error with `{nativeEvent: {error}}`.
|
Invoked on load error with `{nativeEvent: {error}}`.
|
||||||
|
|
||||||
**onLoad** function
|
**onLayout**: function
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
**onLoad**: function
|
||||||
|
|
||||||
Invoked when load completes successfully.
|
Invoked when load completes successfully.
|
||||||
|
|
||||||
**onLoadEnd** function
|
**onLoadEnd**: function
|
||||||
|
|
||||||
Invoked when load either succeeds or fails,
|
Invoked when load either succeeds or fails,
|
||||||
|
|
||||||
**onLoadStart** function
|
**onLoadStart**: function
|
||||||
|
|
||||||
Invoked on load start.
|
Invoked on load start.
|
||||||
|
|
||||||
**resizeMode** oneOf('contain', 'cover', 'none', 'stretch')
|
**resizeMode**: oneOf('contain', 'cover', 'none', 'stretch') = 'stretch'
|
||||||
|
|
||||||
Determines how to resize the image when the frame doesn't match the raw image
|
Determines how to resize the image when the frame doesn't match the raw image
|
||||||
dimensions. Default: `stretch`.
|
dimensions.
|
||||||
|
|
||||||
**source** { uri: string }
|
**source**: { uri: string }
|
||||||
|
|
||||||
`uri` is a string representing the resource identifier for the image, which
|
`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.
|
||||||
|
|
||||||
**style** style
|
**style**: style
|
||||||
|
|
||||||
[View](View.md) style
|
[View](View.md) style
|
||||||
|
|
||||||
@@ -60,7 +68,7 @@ Defaults:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**testID** string
|
**testID**: string
|
||||||
|
|
||||||
Used to locate a view in end-to-end tests.
|
Used to locate a view in end-to-end tests.
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
# ListView
|
# ListView
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
**children** any
|
**children**: any
|
||||||
|
|
||||||
Content to display over the image.
|
Content to display over the image.
|
||||||
|
|
||||||
**style** style
|
**style**: style
|
||||||
|
|
||||||
+ `property` type
|
+ `property` type
|
||||||
|
|
||||||
@@ -17,7 +19,6 @@ Defaults:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
@@ -1,27 +1,31 @@
|
|||||||
# ScrollView
|
# ScrollView
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
**children** any
|
**children**: any
|
||||||
|
|
||||||
**contentContainerStyle** style
|
Child content.
|
||||||
|
|
||||||
|
**contentContainerStyle**: style
|
||||||
|
|
||||||
These styles will be applied to the scroll view content container which wraps
|
These styles will be applied to the scroll view content container which wraps
|
||||||
all of the child views. Example:
|
all of the child views. Example:
|
||||||
|
|
||||||
**horizontal** bool
|
**horizontal**: bool = false
|
||||||
|
|
||||||
When true, the scroll view's children are arranged horizontally in a row instead of vertically in a column. Default: `false`.
|
When true, the scroll view's children are arranged horizontally in a row instead of vertically in a column. Default: `false`.
|
||||||
|
|
||||||
**onScroll** function
|
**onScroll**: function
|
||||||
|
|
||||||
Fires at most once per frame during scrolling. The frequency of the events can be contolled using the `scrollEventThrottle` prop.
|
Fires at most once per frame during scrolling. The frequency of the events can be contolled using the `scrollEventThrottle` prop.
|
||||||
|
|
||||||
**scrollEnabled** bool
|
**scrollEnabled**: bool
|
||||||
|
|
||||||
When false, the content does not scroll. Default: `true`.
|
When false, the content does not scroll. Default: `true`.
|
||||||
|
|
||||||
**scrollEventThrottle** number
|
**scrollEventThrottle**: number
|
||||||
|
|
||||||
This controls how often the scroll event will be fired while scrolling (in
|
This controls how often the scroll event will be fired while scrolling (in
|
||||||
events per seconds). A higher number yields better accuracy for code that is
|
events per seconds). A higher number yields better accuracy for code that is
|
||||||
@@ -29,7 +33,7 @@ tracking the scroll position, but can lead to scroll performance problems.
|
|||||||
Default: `0` (the scroll event will be sent only once each time the view is
|
Default: `0` (the scroll event will be sent only once each time the view is
|
||||||
scrolled.)
|
scrolled.)
|
||||||
|
|
||||||
**style** style
|
**style**: style
|
||||||
|
|
||||||
[View](View.md) style
|
[View](View.md) style
|
||||||
|
|
||||||
|
|||||||
@@ -1,64 +1,66 @@
|
|||||||
# Swipeable
|
# Swipeable
|
||||||
|
|
||||||
|
Unique to web.
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
**delta** number
|
**delta**: number = 10
|
||||||
|
|
||||||
Number of pixels that must be swiped before events are dispatched. Default: `10`.
|
Number of pixels that must be swiped before events are dispatched.
|
||||||
|
|
||||||
**flickThreshold** number
|
**flickThreshold**: number = 0.6
|
||||||
|
|
||||||
The velocity threshold at which a swipe is considered a flick. Default: `0.6`.
|
The velocity threshold at which a swipe is considered a flick.
|
||||||
|
|
||||||
**onSwiped** function
|
**onSwiped**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, deltaX, deltaY, isFlick) => swipeHandler
|
(SyntheticTouchEvent, deltaX, deltaY, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called once a swipe has ended.
|
Called once a swipe has ended.
|
||||||
|
|
||||||
**onSwipedDown** function
|
**onSwipedDown**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called once a swipe-down has ended.
|
Called once a swipe-down has ended.
|
||||||
|
|
||||||
**onSwipedLeft** function
|
**onSwipedLeft**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called once a swipe-left has ended.
|
Called once a swipe-left has ended.
|
||||||
|
|
||||||
**onSwipedUp** function
|
**onSwipedUp**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called once a swipe-up has ended.
|
Called once a swipe-up has ended.
|
||||||
|
|
||||||
**onSwipedRight** function
|
**onSwipedRight**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called once a swipe-right has ended.
|
Called once a swipe-right has ended.
|
||||||
|
|
||||||
**onSwipingDown** function
|
**onSwipingDown**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called while a swipe-down is in progress.
|
Called while a swipe-down is in progress.
|
||||||
|
|
||||||
**onSwipingLeft** function
|
**onSwipingLeft**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called while a swipe-left is in progress.
|
Called while a swipe-left is in progress.
|
||||||
|
|
||||||
**onSwipingRight** function
|
**onSwipingRight**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
Called while a swipe-right is in progress.
|
Called while a swipe-right is in progress.
|
||||||
|
|
||||||
**onSwipingUp** function
|
**onSwipingUp**: function
|
||||||
|
|
||||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||||
|
|
||||||
|
|||||||
+32
-12
@@ -4,25 +4,41 @@
|
|||||||
style, layout with flexbox, and accessibility controls. It can be nested
|
style, layout with flexbox, and accessibility controls. It can be nested
|
||||||
inside another `View` and has 0-to-many children of any type.
|
inside another `View` and has 0-to-many children of any type.
|
||||||
|
|
||||||
|
Unsupported React Native props:
|
||||||
|
`accessibilityComponentType` (android) – use `accessibilityRole`,
|
||||||
|
`accessibilityTraits` (ios) – use `accessibilityRole`,
|
||||||
|
`collapsable` (android),
|
||||||
|
`importantForAccessibility` (android),
|
||||||
|
`needsOffscreenAlphaCompositing` (android),
|
||||||
|
`onAccessibilityTap`,
|
||||||
|
`onMagicTap`,
|
||||||
|
`onMoveShouldSetResponder`,
|
||||||
|
`onResponder*`,
|
||||||
|
`onStartShouldSetResponder`,
|
||||||
|
`onStartShouldSetResponderCapture`
|
||||||
|
`removeClippedSubviews` (ios),
|
||||||
|
`renderToHardwareTextureAndroid` (android),
|
||||||
|
`shouldRasterizeIOS` (ios)
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
NOTE: `View` will transfer all other props to the rendered HTML element.
|
NOTE: `View` will transfer all other props to the rendered HTML element.
|
||||||
|
|
||||||
**accessibilityLabel** string
|
**accessibilityLabel**: string
|
||||||
|
|
||||||
Defines the text available to assistive technologies upon interaction with the
|
Defines the text available to assistive technologies upon interaction with the
|
||||||
element. (This is implemented using `aria-label`.)
|
element. (This is implemented using `aria-label`.)
|
||||||
|
|
||||||
**accessibilityLiveRegion** oneOf('assertive', 'off', 'polite')
|
**accessibilityLiveRegion**: oneOf('assertive', 'off', 'polite') = 'off'
|
||||||
|
|
||||||
Indicates to assistive technologies whether to notify the user when the view
|
Indicates to assistive technologies whether to notify the user when the view
|
||||||
changes. The values of this attribute are expressed in degrees of importance.
|
changes. The values of this attribute are expressed in degrees of importance.
|
||||||
When regions are specified as `polite` (recommended), updates take low
|
When regions are specified as `polite` (recommended), updates take low
|
||||||
priority. When regions are specified as `assertive`, assistive technologies
|
priority. When regions are specified as `assertive`, assistive technologies
|
||||||
will interrupt and immediately notify the user. Default: `off`. (This is
|
will interrupt and immediately notify the user. (This is implemented using
|
||||||
implemented using [`aria-live`](http://www.w3.org/TR/wai-aria/states_and_properties#aria-live).)
|
[`aria-live`](http://www.w3.org/TR/wai-aria/states_and_properties#aria-live).)
|
||||||
|
|
||||||
**accessibilityRole** oneOf(roles)
|
(web) **accessibilityRole**: oneOf(roles)
|
||||||
|
|
||||||
Allows assistive technologies to present and support interaction with the view
|
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
|
in a manner that is consistent with user expectations for similar views of that
|
||||||
@@ -33,16 +49,20 @@ Note: Avoid changing `accessibilityRole` values over time or after user
|
|||||||
actions. Generally, accessibility APIs do not provide a means of notifying
|
actions. Generally, accessibility APIs do not provide a means of notifying
|
||||||
assistive technologies of a `role` value change.
|
assistive technologies of a `role` value change.
|
||||||
|
|
||||||
**accessible** bool
|
**accessible**: bool = true
|
||||||
|
|
||||||
When `false`, the view is hidden from assistive technologies. Default: `true`. (This is
|
When `false`, the view is hidden from assistive technologies. (This is
|
||||||
implemented using `aria-hidden`.)
|
implemented using `aria-hidden`.)
|
||||||
|
|
||||||
**component** function or string
|
(web) **component**: function | string = 'div'
|
||||||
|
|
||||||
The React Component for this view. Default: `div`.
|
The React Component for this view.
|
||||||
|
|
||||||
**pointerEvents** oneOf('auto', 'box-only', 'box-none', 'none')
|
**onLayout**: function
|
||||||
|
|
||||||
|
(TODO)
|
||||||
|
|
||||||
|
**pointerEvents**: oneOf('auto', 'box-only', 'box-none', 'none') = 'auto'
|
||||||
|
|
||||||
Configure the `pointerEvents` of the view. The enhanced `pointerEvents` modes
|
Configure the `pointerEvents` of the view. The enhanced `pointerEvents` modes
|
||||||
provided are not part of the CSS spec, therefore, `pointerEvents` is excluded
|
provided are not part of the CSS spec, therefore, `pointerEvents` is excluded
|
||||||
@@ -62,7 +82,7 @@ from `style`.
|
|||||||
.box-only * { pointer-events: none }
|
.box-only * { pointer-events: none }
|
||||||
```
|
```
|
||||||
|
|
||||||
**style** style
|
**style**: style
|
||||||
|
|
||||||
+ `alignContent`
|
+ `alignContent`
|
||||||
+ `alignItems`
|
+ `alignItems`
|
||||||
@@ -132,7 +152,7 @@ Default:
|
|||||||
|
|
||||||
(See [facebook/css-layout](https://github.com/facebook/css-layout)).
|
(See [facebook/css-layout](https://github.com/facebook/css-layout)).
|
||||||
|
|
||||||
**testID** string
|
**testID**: string
|
||||||
|
|
||||||
Used to locate this view in end-to-end tests.
|
Used to locate this view in end-to-end tests.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user