0.1.8 • Published 7 months ago

react-native-tabbedlist v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

react-native-tabbedlist

React Native Scrollable Tabbed List.

Installation

npm install react-native-tabbedlist

Usage

import { TabbedList } from 'react-native-tabbedlist';

// ...

 const DATA: Data[] = [
    {
      title: 'Section 1',
      data: ['Item 1-1', 'Item 1-2', 'Item 1-3'],
    },
    {
      title: 'Section 2',
      data: ['Item 2-1', 'Item 2-2', 'Item 2-3'],
    }
 ]

const renderListItem = (item: any) => {
    return (
      <View style={styles.listItem}>
        <Text>{item}</Text>
      </View>
    );
  };

  const renderTabItem = ({
    item,
    isSelected,
  }: {
    item: any;
    isSelected: boolean;
  }) => {
    return (
      <View style={styles.tabItem}>
        <Text style={isSelected && styles.selected}>{item.title}</Text>
      </View>
    );
  };

  const renderSectionHeader = (section: SectionListData<Data>) => {
    return (
      <View style={styles.sectionHeader}>
        <Text>{section.title}</Text>
      </View>
    );
  };

  const listHeader = (
    <View style={styles.header}>
      <Text>List Header</Text>
    </View>
  );



return (
    <TabbedList
        data={DATA}
        listHeader={listHeader}
        renderListItem={renderListItem}
        renderTabItem={renderTabItem}
        renderSectionHeader={renderSectionHeader}
    />;
)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.1.8

7 months ago

0.1.7

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.61

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago