1.0.4 • Published 1 year ago

@jazebjaved/accordion v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

accordion-npm-package

React Native Accordion Component

Installation

npm install @jazebjaved/accordion or yarn add @jazebjaved/accordion

Install the following dependency if not already installed.

Dependencies

react-native-svg

npm install react-native-svg or yarn add react-native-svg

Usage

import Accordion from '@jazebjaved/accordion'

Template with types

<Accordion title={<string>} content={<ReactNode>}/>

Example

<Accordion title="Title" content={<View><Text>Content</Text></View>}/>

Props

PropTypeDescriptionRequiredDefault Value
titlestringTitle of the accordion-
contentReactNodeContent of the accordion-
pxnumberPadding on x-axis10
pynumberPadding on y-axis6
bgCstringBackground color of the accordion#eee
borderRadiusnumberBorder radius of the accordion6
gapnumberGap between title and content10
titleColorstringColor of the title#000
titleFontSizenumberFont size of the title16
titleFontWeightstringFont weight of the title600
contentBgCstringBackground color of the content#fff
contentPxnumberPadding on x-axis of the content10
contentPynumberPadding on y-axis of the content6

Example

import React from 'react';
import {View, Text} from 'react-native';
import Accordion from '@jazebjaved/accordion';

const App = () => {
  return (
    <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
      <Accordion
        title="Title"
        content={
          <View>
            <Text>Content</Text>
          </View>
        }
      />
    </View>
  );
};

export default App;

Versions

version 1.0.4 (current)

New : custom styling for accordion title and content.

version 1.0.3

Updated deafult styling of accordion.

version 1.0.2

Updated Readme.md

version 1.0.1

Added basic accordion functionality.

version 1.0.0

Initial release of accordion package.

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago