1.0.8 • Published 2 years ago

expandablecard v1.0.8

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

expandablecard

A simple and animated expandable card for React Native.

Example
:-------------------------: This is a demo.

Installation

npm i expandablecard

Usage

import ExpandableCard from 'expandablecard';
<View style={{flex: 1}}>
            <ExpandableCard
                title='test card one'
                expanded>
                <View style={{ height: 200, width: 200, backgroundColor: 'red' }}>
                </View>
            </ExpandableCard>
            <ExpandableCard
                title='test card two'
                expanded={false}
                contentContainerStyle={{ alignItems: 'center' }}>
                <View>
                    <Image
                        style={{ height: 150, width: 200 }}
                        source={{ uri: 'https://cars.usnews.com/static/images/Auto/custom/14737/2022_Acura_ILX_1.jpg' }} />
                </View>
            </ExpandableCard>
            <ExpandableCard
                title='test card three'
                expanded>
                <View style={{ height: 300, width: 200, backgroundColor: 'orange' }}>
                </View>
            </ExpandableCard>
</View>

Documentation

Props

NameDescriptionDefaultType
expandedWhether to expand the card or nottrueBoolean
animationDurationDuration of animation in milliseconds300Number
iconSizesize on indicator24Number
titleheader title''String
activeOpacitythe opacity of header view when touch0.8Number
indicatorindicator component to rendernullcomponent
headerStylestyle for headernullViewStyle
contentContainerStylestyle for content wrappernullViewStyle
containerStylestyle for card WrappernullViewStyle
contentHeightdefault height for body0Number

Author

Yasser Kassem