react-native-expo-interactive-section-list
TypeScript icon, indicating that this package has built-in type declarations

1.4.1 • Public • Published

React Native Interactive Section List

Interactive Section List is a scrollable tab bar-controlled SectionList.

preview

Features

  • SectionList that scrolls to tab bar button selected sections.
  • Tab bar button controls that follow along with SectionList scroll actions.
  • Compatible with Expo.
  • Written in TypeScript.

Installation

yarn add react-native-expo-interactive-section-list
 
# or 
 
npm install react-native-expo-interactive-section-list

Usage

import React{ useStateuseEffect} from 'react';
 
import InteractiveSectionList from 'react-native-expo-interactive-section-list';
 
import MyItem from './MyItem';
import MySectionHeader from './MySectionHeader';
 
const searchIcon = require('../../assets/search.png');
 
const DATA = [ 
  { 
    title: "Main dishes", 
    data: ["Pizza", "Burger", "Risotto"]
  }, 
  { 
    title: "Sides", 
    data: ["French Fries", "Onion Rings", "Fried Shrimps"]
  }, 
  { 
    title: "Drinks", 
    data: ["Water", "Coke", "Beer"]
  }, 
  { 
    title: "Desserts", 
    data: ["Cheese Cake", "Ice Cream"]
  }
];
 
const Home = () => { 
  const [datasetData] = useState([]);
 
  useEffect(() => { 
    setData(DATA);
  }[]);
 
  return (
    <InteractiveSectionList
      data={data} // REQUIREDSECTIONLIST DATA
      renderItem={({ item }) => <MyItem item={item} />} // REQUIREDSECTIONLIST ITEM COMPONENT
      itemHeight={100}  // REQUIREDUSED TO IMPROVE PERFORMANCE
      renderSectionHeader={({ section }) => <MySectionHeader section={section} />} // OPTIONAL
      tabbarItemWidth={100}  // OPTIONAL
      tabbarItemSpaceBetween={8}  // OPTIONAL
      tabbarItemFontSize={16}  // OPTIONAL
      tabbarItemActiveColor='#FED41A'  // OPTIONAL
      tabbarItemInactiveColor='#FFF'  // OPTIONAL
      tabbarItemTitleActiveColor='#000' // OPTIONAL
      tabbarItemTitleInactiveColor='#EDEDED' // OPTIONAL
      tabbarItemHeight={40}  // OPTIONAL
      tabbarIcon={searchIcon}  // OPTIONAL
    />
  )};
 
export default Home;

License

MIT

Package Sidebar

Install

npm i react-native-expo-interactive-section-list

Weekly Downloads

10

Version

1.4.1

License

MIT

Unpacked Size

59.8 kB

Total Files

22

Last publish

Collaborators

  • henkcorporaal