You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActionSheet is a cross-platform React Native component that uses the native UIActionSheet on iOS and a JS implementation on Android. Almost a drop in replacement for [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html) except it cannot be called statically.
@@ -94,82 +95,93 @@ This library can also be used in the browser with Expo for web.
94
95
95
96
### Universal Props
96
97
97
-
The same options available on React Native's [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html#showactionsheetwithoptions) component exist for both iOS and Android in this library.
98
+
The same options available on React Native's [ActionSheetIOS](https://reactnative.dev/docs/0.64/actionsheetios#showactionsheetwithoptions) component exist for both iOS and Android in this library. Note: `disabledButtonIndicies` is only available for iOS in Expo 43+ or RN 0.64.0+.
iPad only option that allows for docking the action sheet to a node. See [ShowActionSheetButton.tsx](/example/ShowActionSheetButton.tsx) for an example on how to implement this.
108
110
109
111
#### `userInterfaceStyle` (optional)
112
+
110
113
The interface style used for the action sheet, can be set to `light` or `dark`, otherwise the default system style will be used.
111
114
112
115
### Android/Web-Only Props
113
116
114
117
The below props allow modification of the Android ActionSheet. They have no effect on the look on iOS as the native iOS Action Sheet does not have options for modifying these options.
| icons | array of required images or icons | No ||
122
+
| tintIcons | boolean | No | true |
123
+
| textStyle | TextStyle | No ||
124
+
| titleTextStyle | TextStyle | No ||
125
+
| messageTextStyle | TextStyle | No ||
126
+
| autoFocus | boolean | No | false |
127
+
| showSeparators | boolean | No | false |
128
+
| containerStyle | ViewStyle | No ||
129
+
| separatorStyle | ViewStyle | No ||
130
+
| useModal | boolean | No | false (true if autoFocus is true) |
131
+
| destructiveColor | string | No | #d32f2f |
130
132
131
133
#### `icons` (optional)
132
134
133
135
Show icons to go along with each option. If image source paths are provided via `require`, images will be rendered for you. Alternatively, you can provide an array of elements such as vector icons, pre-rendered Images, etc.
134
136
135
137
#### `tintIcons` (optional)
136
-
Icons by default will be tinted to match the text color. When set to false, the icons will be the color of the source image. This is useful if you want to use multicolor icons. If you provide your own nodes/pre-rendered icons rather than required images in the `icons` array, you will need to tint them appropriately before providing them in the array of `icons`; `tintColor` will not be applied to icons unless they are images from a required source.
138
+
139
+
Icons by default will be tinted to match the text color. When set to false, the icons will be the color of the source image. This is useful if you want to use multicolor icons. If you provide your own nodes/pre-rendered icons rather than required images in the `icons` array, you will need to tint them appropriately before providing them in the array of `icons`; `tintColor` will not be applied to icons unless they are images from a required source.
137
140
138
141
#### `textStyle` (optional)
142
+
139
143
Apply any text style props to the options. If the `tintColor` option is provided, it takes precedence over a color text style prop.
140
144
141
145
#### `titleTextStyle` (optional)
146
+
142
147
Apply any text style props to the title if present.
143
148
144
149
#### `messageTextStyle` (optional)
150
+
145
151
Apply any text style props to the message if present.
146
152
147
153
#### `autoFocus`: (optional)
154
+
148
155
If true, will give the first option screen reader focus automatically when the action sheet becomes visible.
149
156
On iOS, this is the default behavior of the native action sheet.
150
157
151
158
#### `showSeparators`: (optional)
159
+
152
160
Show separators between items. On iOS, separators always show so this prop has no effect.
153
161
154
162
#### `containerStyle`: (optional)
163
+
155
164
Apply any view style props to the container rather than use the default look (e.g. dark mode).
156
165
157
166
#### `separatorStyle`: (optional)
167
+
158
168
Modify the look of the separators rather than use the default look.
159
169
160
170
#### `useModal`: (optional)
171
+
161
172
Wrap the ActionSheet with a Modal, in order to show in front of other Modals that were already opened ([issue reference](https://github.com/expo/react-native-action-sheet/issues/164)).
162
173
163
174
#### `destructiveColor`: (optional)
175
+
164
176
Modify color for text of destructive option.
165
177
166
178
## ActionSheetProvider Props
167
179
168
180
The following props can be set directly on the `ActionSheetProvider`
169
181
170
182
#### `useNativeDriver` (optional)
171
-
Windows only option that provides the option to disable the [native animation](https://reactnative.dev/docs/animated#using-the-native-driver) driver for React Native Windows projects targeting _Windows 10 Version-1809 ; Build-10.0.17763.0_ and earlier. `useNativeDriver` is [supported in Version-1903 and later](https://microsoft.github.io/react-native-windows/docs/win10-compat) so if your project is targeting that, you don't need to set this prop.
172
183
184
+
Windows only option that provides the option to disable the [native animation](https://reactnative.dev/docs/animated#using-the-native-driver) driver for React Native Windows projects targeting _Windows 10 Version-1809 ; Build-10.0.17763.0_ and earlier. `useNativeDriver` is [supported in Version-1903 and later](https://microsoft.github.io/react-native-windows/docs/win10-compat) so if your project is targeting that, you don't need to set this prop.
173
185
174
186
## Try it out
175
187
@@ -180,6 +192,7 @@ Try it in Expo: https://expo.io/@community/react-native-action-sheet-example
180
192
See the [example app](https://github.com/expo/react-native-action-sheet/tree/master/example).
0 commit comments