react-native-touchable-action 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +63 -31
- package/package.json +5 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -29,28 +29,72 @@ yarn add react-native-touchable-action
|
|
|
29
29
|
|
|
30
30
|
##
|
|
31
31
|
|
|
32
|
-
####
|
|
33
|
-
|
|
34
|
-
> To position your floating action, use the React Native style prop
|
|
32
|
+
#### Import the FloatingActionButton component
|
|
35
33
|
```js
|
|
36
34
|
import FloatingActionButton from 'react-native-touchable-action';
|
|
37
35
|
```
|
|
36
|
+
#### Usage
|
|
38
37
|
```js
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
import React from 'react';
|
|
39
|
+
import {
|
|
40
|
+
Text,
|
|
41
|
+
View,
|
|
42
|
+
StyleSheet,
|
|
43
|
+
} from 'react-native';
|
|
44
|
+
|
|
45
|
+
import FloatingActionButton from 'react-native-touchable-action';
|
|
46
|
+
|
|
47
|
+
const App = () => {
|
|
48
|
+
return (
|
|
49
|
+
<View
|
|
50
|
+
style={styles.container}
|
|
51
|
+
>
|
|
52
|
+
<Text>React Native Touchable Action</Text>
|
|
53
|
+
|
|
54
|
+
<FloatingActionButton
|
|
55
|
+
IconSource='Ionicons'
|
|
56
|
+
iconName='rocket'
|
|
57
|
+
onPress={() => {
|
|
58
|
+
console.log('You pressed the rocket button');
|
|
59
|
+
}}
|
|
60
|
+
style={{
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
bottom: 75,
|
|
63
|
+
right: 50,
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
52
69
|
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
container: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
backgroundColor: '#fff',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
export default App;
|
|
80
|
+
```
|
|
81
|
+
##
|
|
53
82
|
### Props:
|
|
83
|
+
|
|
84
|
+
| Prop | Type | Required | Description
|
|
85
|
+
| :--- | :--- | :--- | :---
|
|
86
|
+
| IconSource | *String* | ***Yes*** | The source of the icon
|
|
87
|
+
| iconName | *String* | ***Yes*** | The name of the icon
|
|
88
|
+
| onPress | *Object({Function})* | No | The action when the user presses the button
|
|
89
|
+
| buttonColor | *String* - Default: #480ca8 | No | The color of the button
|
|
90
|
+
| buttonColorPressed | *String* - Default: #6a4c93 | No | The color of the button when pressed in
|
|
91
|
+
| buttonSize | *Object({Number})* - Default: 65 | No | The size of the button
|
|
92
|
+
| iconSize | *Object({Number})* - Default: 40 | No | The size of the icon inside the button
|
|
93
|
+
| iconColor | *String* - Default: #edf6f9 | No | The color of the icon inside the button
|
|
94
|
+
| iconColorPressed | *String* - Default: #e2eafc | No | The color of the icon color when the button is pressed
|
|
95
|
+
| shaded | *Object({Boolean})* - Default: false | No | The shadow underneath the button when not pressed in. Works best in Light Mode
|
|
96
|
+
##
|
|
97
|
+
|
|
54
98
|
#### IconSource (required)
|
|
55
99
|
> type: String
|
|
56
100
|
###### The source of the icon
|
|
@@ -83,7 +127,7 @@ onPress={() => {
|
|
|
83
127
|
```js
|
|
84
128
|
buttonColor='#0F044C'
|
|
85
129
|
```
|
|
86
|
-
|
|
130
|
+
|
|
87
131
|
```js
|
|
88
132
|
<FloatingActionButton
|
|
89
133
|
IconSource='Ionicons'
|
|
@@ -99,7 +143,6 @@ buttonColor='#0F044C'
|
|
|
99
143
|
buttonColor='#0F044C'
|
|
100
144
|
/>
|
|
101
145
|
```
|
|
102
|
-
|
|
103
146
|
##
|
|
104
147
|
|
|
105
148
|
#### buttonColorPressed
|
|
@@ -114,7 +157,6 @@ buttonColor='#0F044C'
|
|
|
114
157
|
buttonColorPressed='#693C72'
|
|
115
158
|
```
|
|
116
159
|
|
|
117
|
-
##### Example:
|
|
118
160
|
```js
|
|
119
161
|
<FloatingActionButton
|
|
120
162
|
IconSource='Ionicons'
|
|
@@ -131,7 +173,6 @@ buttonColorPressed='#693C72'
|
|
|
131
173
|
buttonColorPressed='#693C72'
|
|
132
174
|
/>
|
|
133
175
|
```
|
|
134
|
-
|
|
135
176
|
##
|
|
136
177
|
|
|
137
178
|
#### buttonSize
|
|
@@ -146,7 +187,6 @@ buttonColorPressed='#693C72'
|
|
|
146
187
|
buttonSize={75}
|
|
147
188
|
```
|
|
148
189
|
|
|
149
|
-
##### Example
|
|
150
190
|
```js
|
|
151
191
|
<FloatingActionButton
|
|
152
192
|
IconSource='Ionicons'
|
|
@@ -164,12 +204,11 @@ buttonSize={75}
|
|
|
164
204
|
buttonSize={75}
|
|
165
205
|
/>
|
|
166
206
|
```
|
|
167
|
-
|
|
168
207
|
##
|
|
169
208
|
|
|
170
209
|
#### iconSize
|
|
171
210
|
> type: Object({Number}) - Default: 40
|
|
172
|
-
###### The size of the icon inside the button
|
|
211
|
+
###### The size of the icon inside the button
|
|
173
212
|
###### This only changes the size of the icon inside the button, not the size of the button itself
|
|
174
213
|
|
|
175
214
|
<img width="105" alt="Icon50" src="https://github.com/cartagenae/react-native-touchable-action/assets/6395465/ab76f0b2-039d-4cb6-89a1-cb4b4be367c3"> | <img width="105" alt="Icon35" src="https://github.com/cartagenae/react-native-touchable-action/assets/6395465/63220fcd-b598-4ab1-94f2-5b46f6184d67">
|
|
@@ -180,7 +219,6 @@ buttonSize={75}
|
|
|
180
219
|
iconSize={35}
|
|
181
220
|
```
|
|
182
221
|
|
|
183
|
-
##### Example
|
|
184
222
|
```js
|
|
185
223
|
<FloatingActionButton
|
|
186
224
|
IconSource='Ionicons'
|
|
@@ -199,7 +237,6 @@ iconSize={35}
|
|
|
199
237
|
iconSize={35}
|
|
200
238
|
/>
|
|
201
239
|
```
|
|
202
|
-
|
|
203
240
|
##
|
|
204
241
|
|
|
205
242
|
#### iconColor
|
|
@@ -209,7 +246,6 @@ iconSize={35}
|
|
|
209
246
|
iconColor='#edf6f9'
|
|
210
247
|
```
|
|
211
248
|
|
|
212
|
-
##### Example
|
|
213
249
|
```js
|
|
214
250
|
<FloatingActionButton
|
|
215
251
|
IconSource='Ionicons'
|
|
@@ -229,7 +265,6 @@ iconColor='#edf6f9'
|
|
|
229
265
|
iconColor='#edf6f9'
|
|
230
266
|
/>
|
|
231
267
|
```
|
|
232
|
-
|
|
233
268
|
##
|
|
234
269
|
|
|
235
270
|
#### iconColorPressed
|
|
@@ -244,7 +279,6 @@ iconColor='#edf6f9'
|
|
|
244
279
|
iconColorPressed='#c9ccd5'
|
|
245
280
|
```
|
|
246
281
|
|
|
247
|
-
##### Example
|
|
248
282
|
```js
|
|
249
283
|
<FloatingActionButton
|
|
250
284
|
IconSource='Ionicons'
|
|
@@ -265,7 +299,6 @@ iconColorPressed='#c9ccd5'
|
|
|
265
299
|
iconColorPressed='#c9ccd5'
|
|
266
300
|
/>
|
|
267
301
|
```
|
|
268
|
-
|
|
269
302
|
##
|
|
270
303
|
|
|
271
304
|
#### shaded
|
|
@@ -280,7 +313,6 @@ iconColorPressed='#c9ccd5'
|
|
|
280
313
|
shaded={true}
|
|
281
314
|
```
|
|
282
315
|
|
|
283
|
-
##### Example
|
|
284
316
|
```js
|
|
285
317
|
<FloatingActionButton
|
|
286
318
|
IconSource='Ionicons'
|
|
@@ -302,7 +334,7 @@ shaded={true}
|
|
|
302
334
|
shaded={true}
|
|
303
335
|
/>
|
|
304
336
|
```
|
|
305
|
-
|
|
337
|
+
---
|
|
306
338
|
## License
|
|
307
339
|
|
|
308
340
|
React Native Floating Action Button is under the **MIT License**. See bundled <a href='https://github.com/cartagenae/react-native-touchable-action/blob/main/LICENSE' alt='license file'>**LICENSE**</a> file for details.
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-touchable-action",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "A simple floating action button component for any React Native project using Expo",
|
|
5
5
|
"main": "FloatingActionButton.js",
|
|
6
6
|
"author": "Eric Cartagena",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"
|
|
9
|
-
"@expo/vector-icons": "^14.1.0",
|
|
8
|
+
"peerDependencies": {
|
|
10
9
|
"react": "^19.0.0",
|
|
11
10
|
"react-native": "^0.79.5"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@expo/vector-icons": "^14.1.0"
|
|
12
14
|
}
|
|
13
15
|
}
|