File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed
Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 66 AvatarScreen ,
77 BadgeScreen ,
88 ButtonScreen ,
9+ CheckboxGroupScreen ,
910 CheckboxScreen ,
1011 CircularProgressScreen ,
1112 InputScreen ,
@@ -23,7 +24,7 @@ const Drawer = createDrawerNavigator();
2324
2425const AppRoot = ( ) => {
2526 return (
26- < Drawer . Navigator initialRouteName = "InputScreen " >
27+ < Drawer . Navigator initialRouteName = "CheckboxGroupScreen " >
2728 < Drawer . Screen
2829 options = { { title : "Avatar" } }
2930 name = "AvatarScreen"
@@ -99,6 +100,11 @@ const AppRoot = () => {
99100 name = "InputScreen"
100101 component = { InputScreen }
101102 />
103+ < Drawer . Screen
104+ options = { { title : "Checkbox Group" } }
105+ name = "CheckboxGroupScreen"
106+ component = { CheckboxGroupScreen }
107+ />
102108 </ Drawer . Navigator >
103109 ) ;
104110} ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import {
3+ Box ,
4+ Checkbox ,
5+ CheckboxGroup ,
6+ Text ,
7+ useTheme ,
8+ } from "@adaptui/react-native-tailwind" ;
9+
10+ export const CheckboxGroupScreen = ( ) => {
11+ const tailwind = useTheme ( ) ;
12+ const [ value , setValue ] = React . useState < string [ ] > ( [ ] ) ;
13+ return (
14+ < Box style = { tailwind . style ( "flex-1 px-2 justify-center bg-white-900" ) } >
15+ < Text > Pick fruits to eat</ Text >
16+ < CheckboxGroup value = { value } onChange = { setValue } >
17+ < Checkbox value = "apple" label = "Apple" />
18+ < Checkbox value = "orange" label = "Orange" />
19+ < Checkbox value = "watermelon" label = "Watermelon" />
20+ < Checkbox value = "sapota" label = "Sapota" />
21+ < Checkbox value = "cherry" label = "Cherry" />
22+ </ CheckboxGroup >
23+ < Box style = { tailwind . style ( "mt-2" ) } >
24+ < Text > Picked fruits</ Text >
25+ { value . map ( ( item , index ) => {
26+ return (
27+ < Text style = { tailwind . style ( "my-1" ) } key = { index } >
28+ - { item }
29+ </ Text >
30+ ) ;
31+ } ) }
32+ </ Box >
33+ </ Box >
34+ ) ;
35+ } ;
Original file line number Diff line number Diff line change 1+ export * from "./CheckboxGroupScreen" ;
12export * from "./InputScreen" ;
23export * from "./RadioScreen" ;
34export * from "./SliderComponentScreen" ;
You can’t perform that action at this time.
0 commit comments