Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@raiden16f7/react-native-alphabet-list

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@raiden16f7/react-native-alphabet-list

React Native Alphabet List

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by40%
Maintainers
1
Weekly downloads
 
Created
Source

@Raiden16F7/react-native-alphabet-list

React Native Alphabet List Component use reanimated 2 library with refresh control
Fork of @nghinv/react-native-alphabet-list


Version MIT License All Contributors PRs Welcome

Installation

yarn add @raiden16f7/react-native-alphabet-list

or

npm install @raiden16f7/react-native-alphabet-list
yarn add react-native-gesture-handler react-native-reanimated react-native-redash react-fast-compare

Setup react-native-gesture-handler and reanimated according to their docs.

Usage

import React, { useState, useCallback } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import AlphabetList from '@raiden16f7/react-native-alphabet-list';
import { Alphabet } from '@raiden16f7/react-native-alphabet-list/utils';
import { CharType, ItemType } from '@raiden16f7/react-native-alphabet-list/types';

const DATA: Array<{ name: string, key: CharType }> = [];

Alphabet.forEach(char => {
  const random = Math.round(8 * Math.random());
  if (random > 0) {
    for (let i = 0; i < random; i++) {
      const contact = `${char.toLocaleUpperCase()} - Contact ${i + 1}`;
      DATA.push({
        name: contact,
        key: char as CharType,
      });
    }
  }
});

function App() {
  const renderItem = ({ item }: ItemType) => {
    return (
      <View style={styles.viewContent}>
        <Text style={styles.txtContent}>{item.name}</Text>
      </View>
    );
  };

  return (
    <View style={styles.container}>
      <AlphabetList
        data={DATA}
        renderItem={renderItem}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingVertical: 24,
  },
  viewContent: {
    paddingRight: 16,
    paddingLeft: 40,
    marginBottom: 24,
  },
  txtContent: {
    fontSize: 16,
    color: 'white',
  },
});

export default App;

Property

PropertyTypeDefaultDescription
styleViewStyleundefined
contentContainerStyleViewStyleundefined
indexStyleViewStyleundefined
dataArray<{ key: string, [key string]: any }>undefined
renderHeader(header: string) => React.ReactNodeundefined
renderItem({ item, index }) => React.ReactNodeundefined
showAllHeaderbooleanfalse
trackSizenumber18
trackColorstringwhite
charHeightnumber20
trackScalenumber1.5
lineWidthnumber20
trackScalenumber1.5
textColorActivestringtomato
textInactiveColorstringwhite
headerTitleColorstringwhite
charStyleTextStyleundefined
headerTitleStyleTextStyleundefined
headerStyleViewStyleundefined
refreshControlRefreshControlundefined

Created By

TourXpress Logo

Credits

  • Fork of @Nghi-NV

Keywords

FAQs

Package last updated on 19 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc