()
| 2 | import { Grid } from "jetpack-compose-react-native"; |
| 3 | |
| 4 | export default function GridsExample() { |
| 5 | return ( |
| 6 | <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 20 }}> |
| 7 | <Text style={styles.header}>Grids Example</Text> |
| 8 | <Text style={[styles.header, { fontSize: 24 }]}>LazyVerticalGrid</Text> |
| 9 | {/* vertical grid it's by default */} |
| 10 | <Grid gridCellsType="fixed" size={5}> |
| 11 | {Array.from({ length: 50 }).map((_, index) => ( |
| 12 | <Text key={index}>{index}</Text> |
| 13 | ))} |
| 14 | </Grid> |
| 15 | |
| 16 | <Text style={[styles.header, { fontSize: 24 }]}> |
| 17 | LazyVerticalStaggeredGrid |
| 18 | </Text> |
| 19 | {/* vertical staggered grid it's by default */} |
| 20 | <Grid staggered spacedBy={5}> |
| 21 | {Array.from({ length: 30 }).map((_, index) => ( |
| 22 | <Text key={index}>{index}</Text> |
| 23 | ))} |
| 24 | </Grid> |
| 25 | |
| 26 | <Text style={[styles.header, { fontSize: 24 }]}>LazyHorizontalGrid</Text> |
| 27 | <Grid horizontal gridCellsType="adaptive"> |
| 28 | {Array.from({ length: 30 }).map((_, index) => ( |
| 29 | <Text key={index}>{index}</Text> |
| 30 | ))} |
| 31 | </Grid> |
| 32 | |
| 33 | <Text style={[styles.header, { fontSize: 24 }]}> |
| 34 | LazyHorizontalStaggeredGrid |
| 35 | </Text> |
| 36 | <Grid horizontal staggered spacedBy={5} style={{ height: 150 }}> |
| 37 | {Array.from({ length: 30 }).map((_, index) => ( |
| 38 | <Text key={index}>{index}</Text> |
| 39 | ))} |
| 40 | </Grid> |
| 41 | </ScrollView> |
| 42 | ); |
| 43 | } |
| 44 | |
| 45 | const styles = StyleSheet.create({ |
| 46 | header: { |
nothing calls this directly
no outgoing calls
no test coverage detected