react-native-touchable-action 1.0.10 → 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/FloatingActionButton.js +1 -1
- package/LICENSE +19 -0
- package/README.md +85 -53
- package/package.json +6 -4
package/FloatingActionButton.js
CHANGED
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright © 2026 Eric Cartagena
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@ iOS | Android
|
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
|
-
```
|
|
14
|
+
```js
|
|
15
15
|
npm install --save react-native-touchable-action
|
|
16
16
|
```
|
|
17
17
|
or
|
|
18
|
-
```
|
|
18
|
+
```js
|
|
19
19
|
yarn add react-native-touchable-action
|
|
20
20
|
```
|
|
21
21
|
|
|
@@ -29,32 +29,76 @@ 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
|
|
35
|
-
```
|
|
32
|
+
#### Import the FloatingActionButton component
|
|
33
|
+
```js
|
|
36
34
|
import FloatingActionButton from 'react-native-touchable-action';
|
|
37
35
|
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
#### Usage
|
|
37
|
+
```js
|
|
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
|
+
}
|
|
69
|
+
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
container: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
backgroundColor: '#fff',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
},
|
|
77
|
+
})
|
|
52
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
|
|
57
|
-
```
|
|
101
|
+
```js
|
|
58
102
|
IconSource='Ionicons'
|
|
59
103
|
```
|
|
60
104
|
##
|
|
@@ -62,7 +106,7 @@ IconSource='Ionicons'
|
|
|
62
106
|
#### iconName (required)
|
|
63
107
|
> type: String
|
|
64
108
|
###### The name of the icon
|
|
65
|
-
```
|
|
109
|
+
```js
|
|
66
110
|
iconName='rocket'
|
|
67
111
|
```
|
|
68
112
|
##
|
|
@@ -70,7 +114,7 @@ iconName='rocket'
|
|
|
70
114
|
#### onPress
|
|
71
115
|
> type: Object({Function})
|
|
72
116
|
###### The action when the user presses the button
|
|
73
|
-
```
|
|
117
|
+
```js
|
|
74
118
|
onPress={() => {
|
|
75
119
|
console.log('You pressed the rocket button');
|
|
76
120
|
}
|
|
@@ -80,11 +124,11 @@ onPress={() => {
|
|
|
80
124
|
#### buttonColor
|
|
81
125
|
> type: String - Default: #480ca8
|
|
82
126
|
###### The color of the button
|
|
83
|
-
```
|
|
127
|
+
```js
|
|
84
128
|
buttonColor='#0F044C'
|
|
85
129
|
```
|
|
86
|
-
|
|
87
|
-
```
|
|
130
|
+
|
|
131
|
+
```js
|
|
88
132
|
<FloatingActionButton
|
|
89
133
|
IconSource='Ionicons'
|
|
90
134
|
iconName='rocket'
|
|
@@ -99,7 +143,6 @@ buttonColor='#0F044C'
|
|
|
99
143
|
buttonColor='#0F044C'
|
|
100
144
|
/>
|
|
101
145
|
```
|
|
102
|
-
|
|
103
146
|
##
|
|
104
147
|
|
|
105
148
|
#### buttonColorPressed
|
|
@@ -110,12 +153,11 @@ buttonColor='#0F044C'
|
|
|
110
153
|
:------------------:|:------------------:
|
|
111
154
|
ButtonColor | ButtonColorPressed
|
|
112
155
|
|
|
113
|
-
```
|
|
156
|
+
```js
|
|
114
157
|
buttonColorPressed='#693C72'
|
|
115
158
|
```
|
|
116
159
|
|
|
117
|
-
|
|
118
|
-
```
|
|
160
|
+
```js
|
|
119
161
|
<FloatingActionButton
|
|
120
162
|
IconSource='Ionicons'
|
|
121
163
|
iconName='rocket'
|
|
@@ -131,7 +173,6 @@ buttonColorPressed='#693C72'
|
|
|
131
173
|
buttonColorPressed='#693C72'
|
|
132
174
|
/>
|
|
133
175
|
```
|
|
134
|
-
|
|
135
176
|
##
|
|
136
177
|
|
|
137
178
|
#### buttonSize
|
|
@@ -142,12 +183,11 @@ buttonColorPressed='#693C72'
|
|
|
142
183
|
:--------------:|:--------------:
|
|
143
184
|
Button Size 75 | Button Size 55
|
|
144
185
|
|
|
145
|
-
```
|
|
186
|
+
```js
|
|
146
187
|
buttonSize={75}
|
|
147
188
|
```
|
|
148
189
|
|
|
149
|
-
|
|
150
|
-
```
|
|
190
|
+
```js
|
|
151
191
|
<FloatingActionButton
|
|
152
192
|
IconSource='Ionicons'
|
|
153
193
|
iconName='rocket'
|
|
@@ -164,24 +204,22 @@ 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">
|
|
176
215
|
:------------:|:------------:
|
|
177
216
|
Icon Size 50 | Icon Size 35
|
|
178
217
|
|
|
179
|
-
```
|
|
218
|
+
```js
|
|
180
219
|
iconSize={35}
|
|
181
220
|
```
|
|
182
221
|
|
|
183
|
-
|
|
184
|
-
```
|
|
222
|
+
```js
|
|
185
223
|
<FloatingActionButton
|
|
186
224
|
IconSource='Ionicons'
|
|
187
225
|
iconName='rocket'
|
|
@@ -199,18 +237,16 @@ iconSize={35}
|
|
|
199
237
|
iconSize={35}
|
|
200
238
|
/>
|
|
201
239
|
```
|
|
202
|
-
|
|
203
240
|
##
|
|
204
241
|
|
|
205
242
|
#### iconColor
|
|
206
243
|
> type: String - Default: #edf6f9
|
|
207
244
|
###### The color of the icon inside the button
|
|
208
|
-
```
|
|
245
|
+
```js
|
|
209
246
|
iconColor='#edf6f9'
|
|
210
247
|
```
|
|
211
248
|
|
|
212
|
-
|
|
213
|
-
```
|
|
249
|
+
```js
|
|
214
250
|
<FloatingActionButton
|
|
215
251
|
IconSource='Ionicons'
|
|
216
252
|
iconName='rocket'
|
|
@@ -229,7 +265,6 @@ iconColor='#edf6f9'
|
|
|
229
265
|
iconColor='#edf6f9'
|
|
230
266
|
/>
|
|
231
267
|
```
|
|
232
|
-
|
|
233
268
|
##
|
|
234
269
|
|
|
235
270
|
#### iconColorPressed
|
|
@@ -240,12 +275,11 @@ iconColor='#edf6f9'
|
|
|
240
275
|
:------------------:|:------------------:
|
|
241
276
|
Icon color | Icon Color Pressed
|
|
242
277
|
|
|
243
|
-
```
|
|
278
|
+
```js
|
|
244
279
|
iconColorPressed='#c9ccd5'
|
|
245
280
|
```
|
|
246
281
|
|
|
247
|
-
|
|
248
|
-
```
|
|
282
|
+
```js
|
|
249
283
|
<FloatingActionButton
|
|
250
284
|
IconSource='Ionicons'
|
|
251
285
|
iconName='rocket'
|
|
@@ -265,7 +299,6 @@ iconColorPressed='#c9ccd5'
|
|
|
265
299
|
iconColorPressed='#c9ccd5'
|
|
266
300
|
/>
|
|
267
301
|
```
|
|
268
|
-
|
|
269
302
|
##
|
|
270
303
|
|
|
271
304
|
#### shaded
|
|
@@ -276,12 +309,11 @@ iconColorPressed='#c9ccd5'
|
|
|
276
309
|
:----------:|:----------:
|
|
277
310
|
Shaded | Not Shaded
|
|
278
311
|
|
|
279
|
-
```
|
|
312
|
+
```js
|
|
280
313
|
shaded={true}
|
|
281
314
|
```
|
|
282
315
|
|
|
283
|
-
|
|
284
|
-
```
|
|
316
|
+
```js
|
|
285
317
|
<FloatingActionButton
|
|
286
318
|
IconSource='Ionicons'
|
|
287
319
|
iconName='rocket'
|
|
@@ -302,7 +334,7 @@ shaded={true}
|
|
|
302
334
|
shaded={true}
|
|
303
335
|
/>
|
|
304
336
|
```
|
|
305
|
-
|
|
337
|
+
---
|
|
306
338
|
## License
|
|
307
339
|
|
|
308
|
-
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.
|
|
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
|
+
"peerDependencies": {
|
|
9
|
+
"react": "^19.0.0",
|
|
10
|
+
"react-native": "^0.79.5"
|
|
11
|
+
},
|
|
8
12
|
"dependencies": {
|
|
9
|
-
"@expo/vector-icons": "^
|
|
10
|
-
"react": "^18.2.0",
|
|
11
|
-
"react-native": "^0.72.4"
|
|
13
|
+
"@expo/vector-icons": "^14.1.0"
|
|
12
14
|
}
|
|
13
15
|
}
|