1.0.0 • Published 5 years ago

@tickid/react-native-accordion v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Demo

Installation

Yarn:

$ yarn add @tickid/react-native-accordion

or NPM:

$ npm i @tickid/react-native-accordion --save

Usage

Sample code to use this simple library:

import React, { Component } from 'react';
import { Text } from 'react-native';
import { Accordion, Panel } from '@tickid/react-native-accordion';

export default class AccordionExample extends Component {
  render() {
    return (
      <Accordion>
        <Panel title="Panel #1">
          <Text>Content of panel #1</Text>
        </Panel>

        <Panel title="Panel #2">
          <Text>Content of panel #2</Text>
        </Panel>

        <Panel title="Panel #3">
          <Text>Content of panel #3</Text>
        </Panel>
      </Accordion>
    );
  }
}

Props:

<Accordion>

PropertyTypeDefaultDescription
containerStyleStyleStyles are applied to wrap of library. (optional)
panelContainerStyleStyleStyles are applied to each panel. (optional)
showChevronBooleantrueHide / show the panel opening / closing icon. (optional)
iconSizeNumber18Size of chevron icon. (optional)
iconColorString#999Color of chevron icon. (optional)
expandMultipleBooleanfalseAllow more than one section to be expanded. Defaults to false. (optional)

<Panel>

PropertyTypeDefaultDescription
titleStringThe title of the panel. (required)
containerStyleStyleStyles are applied to panel (override panelContainerStyle of <Accordion />). (optional)
onOpenFunctionCalled when panel was opened. (optional)
onCloseFunctionCalled when panel was closed. (optional)