1.4.1 • Published 2 months ago

react-flatlist-ui v1.4.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

FlatList is a utility component UI that makes it easy to handle data rendering lists, and it makes grouping, sorting, UI expansion, styling, and more ...

It is also easy to process the number of data corresponding to media srceen on the screen

GitHub npm GitHub release (latest by date)

react-flatlist-ui

Install

npm install react-flatlist-ui

yarn add react-flatlist-ui

How to use

// This dummyData
dummyData = [
  { id: 1, name: "Correia", img: "https://images.unsplash.com/photo-1234568" },
  { id: 2, name: "Sam", img: "https://images.unsplash.com/photo-1234568" },
  { id: 3, name: "John", img: "https://images.unsplash.com/photo-1234568" },
  { id: 4, name: "James", img: "https://images.unsplash.com/photo-1234568" },
  { id: 5, name: "Steam", img: "https://images.unsplash.com/photo-1234568" },
  { id: 6, name: "Hwan", img: "https://images.unsplash.com/photo-1234568" },
  { id: 7, name: "John", img: "https://images.unsplash.com/photo-1234568" },
  { id: 8, name: "Key", img: "https://images.unsplash.com/photo-1234568" },
  { id: 9, name: "Min", img: "https://images.unsplash.com/photo-1234568" },
  { id: 10, name: "Ellan", img: "https://images.unsplash.com/photo-1234568" },
];

We get the values of dummyData through the data in FlatList, and we pass the unique key values to the keyExtractor, and we get the components through randerItem. This allows you to experience a higher level of performance by taking notes of data.

🔥👍This method is very similar to FlatList in React-Native. Try FlatList in React.js right now🔥👍

import FlatList from 'react-flatList-ui';

...
function App() {
  return (
    <FlatList
      direction="horizontal" // Vertical or horizontal
      data={dummyData} // Data
      dataCount={dummyData.length} // Data count or length
      loading={false} // This Loading State
      keyExtractor={(item) => item.id} // Item key
      renderItem={(item) => <Item name={item.name} img={item.img} />} // Rendering items
      listLoadingComponent={<p>loading...</p>} // loading: true components shown
      ListHeaderComponent={<h1>Title: FlatList</h1>} // Rendered at the top of all the items
      ListFooterComponent={<span>data finish ...</span>} // Rendered at the bottom of all the items
      ItemSeparatorComponent={{<div style={{width:'100%', height:1, backgroundColor:'#eeeeee'}}></div>}} // Components between data
      ListEmptyComponent={<p>Data does not exist ...</p>} // If noneData : view component
            itemHorizontalCount={{ desktop: 3, tablet: 2, mobile: 1 }} // Uf horizontal : media screen data count
      gap={15}
      crossGap={15}
      padding={{ all: 16 }}
      margin={{ bottom: 20 }}
      itemScrollActive={true} // Scroll Active
      listScrollbarView={false} // Scrollbar
    />
  );
}
...

Use Documentation

PropsTypeFeaturesDescriptionDefault
data (*)(Memoization)any[]dataGets the data to sort in the list
dataCountnumberdataCountEnter the total number or length of data
loadingbooleanCurrent loading status or notCurrent loading status or notfalse
keyExtractor (*)(item?: any, index?: number) => string , numberlist keyThe unique id value of the passing data must be passed to the key
renderItem (*)(Memoization)(item?: any, index?: number) => ReactElementrendering of data itemsEffective rendering of dynamic lists and optimized processing for performance and memory use
ItemSeparatorComponentReactElementComponents between listItemYou can handle another element between the elements imported into data
ListLoadingComponentReactElementloading: components that are exposed on the screen when trueloading: components that are exposed on the screen when true
ListEmptyComponentReactElementScreen element when data does not existYou can expose custom elements when data does not exist---
ListHeaderComponentReactElementRendered at the top of all the itemsRendered at the top of all the items
ListFooterComponentReactElementRendered at the bottom of all the itemsRendered at the bottom of all the items
directionhorizontalverticalDetermine the sort of items imported into the datahorizontal : horizontal alignment of data--vertical: data vertical alignmentvertical
itemHorizontalCountdesktop: numbertablet: numbermobile: numberNumber of data exposed in one line during horizontal alignmentNumber of data exposed in one line during horizontal alignmentdesktop: By default, the number of data in a single line that is exposedtable : The number of tablets exposed to the resolution of the tablet with a width of 1080 or lessmobile : the number of data in a line exposed to mobile resolution less than 600 widthdesktop:1tablet:1mobile:1
itemGapnumberDistance between data items based on directionDistance between data items based on direction10
itemCrossGapnumberDistance between data item counteraxes based on directionDistance between data item counteraxes based on direction10
sizewidth: "auto" , "100%" , "100vw"height: "auto" , "100%" , "100vh"minWidth: number , stringmaxWidth: number , stringminHeight: number , stringmaxHeight: number , stringAdjust the entire area of the flatListAdjust the entire area of the flatListwidth:100%height:100%
displayreverse: booleanalign: "start" , "end" , "center" , "stretch"crossAlign: "start" , "end" , "center" , "space-between" , "space-around" , "space-evenly"wrap: "nowrap" , "wrap" , "wrap-reverse"Determine the alignment of items in the Data elementreverse : decide whether to reverse the item in the dataalignment : vertical horizontal alignment based on directioncrossAlign : vertical horizontal alignment of the opposite axis of direction referencewrap : Decides whether to move to the next line when the direction is horizontaldirection === horizontal && wrap
itemScrollActivebooleanIf you need to enable scrolling in the FlatList areaIf you need to enable scrolling in the FlatList area occursfalse
itemScrollbarViewbooleanIf scrollbar exposure is required when itemScrollActive is enabledIf scrollbar exposure is required when itemScrollActive is enabledfalse
paddingall: number , stringhorizontal: number , stringvertical: number , stringtop: number , stringbottom: number , stringleft: number , stringright: number , stringDetermines the padding value of the FlatListall: full & all valuehorizontal: horizontal valuevertical: vertical valuetop: top valueBottom: bottom valueleft: left valueright: right valueall:0
marginall: number , stringhorizontal: number , stringvertical: number , stringtop: number , stringbottom: number , stringleft: number , stringright: number , stringDetermines the margin value of the FlatListall: full & all valuehorizontal: horizontal valuevertical: vertical valuetop: top valueBottom: bottom valueleft: left valueright: right valueall:0
refHTMLUListElement
…props

License

MIT © Deepfactory, Inc. See LICENSE for details.

1.4.1

2 months ago

1.4.0

3 months ago

1.3.1

3 months ago

1.3.0

4 months ago

1.2.0

4 months ago

1.1.1

4 months ago

1.1.5

4 months ago

1.1.4

4 months ago

1.1.3

4 months ago

1.2.1

4 months ago

1.1.2

4 months ago

1.1.0

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago

0.1.9

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.6

4 months ago

0.1.5

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago