Socket
Socket
Sign inDemoInstall

react-native-cupertino-list

Package Overview
Dependencies
521
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-cupertino-list

a Cupertino/iOS list for a React Native


Version published
Weekly downloads
10
decreased by-28.57%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-native-cupertino-list

A Cupertino/iOS list for React Native.

react-native-cupertino-list is released under the MIT license. Current npm package version. supports iOS PRs welcome!

Currently only tested on iOS.

Feature

  • High-reduction iOS system design style (Cupertino)
  • Dark mode support
  • Easily customize icons based on react-native-vector-image
  • Based on SectionList, supports all SectionList's own features (such as List header support, Pull to Refresh...)

Install

npm

npm install react-native-cupertino-list

yarn

yarn add react-native-cupertino-list

You also need to install react-native-vector-image to display the icons.

Usage

import {CupertinoSectionList} from 'react-native-cupertino-list';

export function HomeScreen() {
  return (
      <CupertinoSectionList
        sections={[
          {
            title: 'Settings',
            data: [
              {
                title: 'All Items',
                icon: 'bulb-outline',
                forward: {}
              }
            ],
          },
        ]}
      />
  );
}

API

CupertinoSectionList.sections
PropertyDescriptionTypeDefault
titleTitle of this rowstring-
iconCustomized row icon (left)CupertinoCellIcon-
forwardThe element on the right in this rowForwardType-
onPressCallback executed when select one rowfunction(event)-
CupertinoCellIcon

type: string | { name?: string; color?: ColorValue } | JSX.Element

  1. string - render by react-native-vector-icons (Ionicons)
{
  "icon": "bulb-outline"
}
  1. if you want to customize the color
{
  "icon": {
    "name": "bulb-outline"
    "color": "#000"
  }
}
  1. If you want to fully customize
{
  "icon": (
    <View>...</View>
  )
}
ForwardType

type: { title?: string; icon?: CupertinoCellIcon; arrowHidden?: boolean; }

PropertyDescriptionTypeDefault
titleText displayed to the right of the current rowstring-
iconIcon displayed to the right of the current rowCupertinoCellIcon">" - ios-chevron-forward
arrowHiddenhide the icon on the rightbooleanfalse

example:

{
  "title": "22",
  "icon": "ios-chevron-forward"
}

Custom Icon

You can find the icon you need at react-native-vector-icons directory, fill the icon name into the data.icon field, note that only Ionicons are currently supported.

Other

Inspired by Evan Bacon, Tanks.

Keywords

FAQs

Last updated on 15 Mar 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc