An open API service indexing awesome lists of open source software.

https://github.com/danilichev/rn-section-grid-list

Section Grid List for React Native
https://github.com/danilichev/rn-section-grid-list

react-native sectionlist typescript

Last synced: 4 months ago
JSON representation

Section Grid List for React Native

Awesome Lists containing this project

README

          

# rn-section-grid-list

This package for React Native provides SectionGridList component which works the same as usual SectionList but also adds the ability to render columns in sections by providing numColumns parameter (as in FlatList).

Screenshot

## Installation

```sh
npm install rn-section-grid-list
```

## Usage

```js
import { SectionGridList } from 'rn-section-grid-list';

// ...

const sections = useMemo(
() => [
{ data: ['00', '11', '22'], key: 'Section #1' },
{ data: ['33', '44', '55', '66', '77'], key: 'Section #2' },
{ data: ['88'], key: 'Section #3' },
],
[]
);

// ...

}
renderSectionHeader={({ section }) => (
{section.key}
)}
numColumns={3}
renderItem={({ item }) => (

{item}

)}
sections={sections}
/>;

// ...

const styles = StyleSheet.create({
item: {
alignItems: 'center',
backgroundColor: 'pink',
height: Dimensions.get('window').width * 0.3,
justifyContent: 'center',
minWidth: '30%',
},
rowSeparator: {
height: Dimensions.get('window').width * 0.05,
},
sectionHeaderText: {
fontSize: 16,
fontWeight: 'bold',
marginVertical: 8,
textAlign: 'center',
},
});
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)