Animated collapsible component for React Native, good for accordions, toggles etc
One of the most requested features was added in this release - the ability to have open multiple sections in the Accordion. Be sure to check the example app to see it in action.
To facilitate this; two new props were added.
expandMultiple
- Allows expanding multiple sections
activeSections
- An array of active sections (index)
Props to @jdonald 🎉
All the changes below are for the Accordion
activeSection
is now deprecated.Since we allow for multiple sections now, you'll need to use the new activeSections
prop instead which is an array of indices.
Before | After |
---|---|
<Accordion activeSection={0} /> |
<Accordion activeSections={[0]} /> |
onChange
now returns an array of indices.Previously onChange
would've returned the current index that was active. This change is related to multiple expanded sections.
Before | After |
---|---|
<Accordion onChange={section => // 0} /> |
<Accordion onChange={sections => // [0]} /> |
initiallyActiveSection
is now deprecated.Setting an initial section to be active is now as easy as using setting the activeSections
prop to the index you want.
Before | After |
---|---|
<Accordion initialActiveSection={2} /> |
<Accordion activeSections={[2]} /> |
onAnimationEnd
prop to signal when the collapse animation is over https://github.com/oblador/react-native-collapsible/commit/3a600ca6fe18a84c9dcdd358fe9b944d5b30f026 @EyMaddisAccordion
Import was broken before https://github.com/oblador/react-native-collapsible/commit/ba349c6014a395fea276edb350787dea75c6ba3f
Collapsible
Fix content being laid out repeatedly on collapse https://github.com/oblador/react-native-collapsible/commit/85651da18e51546baba3d6a4ffdf0e0b0bcb420b @andriichernenkoFixed bug https://github.com/oblador/react-native-collapsible/issues/168, released in 0.11.0 as a result of https://github.com/oblador/react-native-collapsible/pull/147.
Primarily fixes issues with moving the typescript definitions locally.
Collapsible
Add style prop https://github.com/oblador/react-native-collapsible/commit/e34b3d120c8bbdcd562610bce06bd467692d2105zz
Accordion
Make renderSectionTitle optional https://github.com/oblador/react-native-collapsible/commit/cb934c53495bb5eec215bd7e8311ed6b6f02d8b7
Accordion
Add touchableComponent and touchableProps https://github.com/oblador/react-native-collapsible/commit/285c871c226d380cde9baa83bcb708e4f9f7a3ef
style
and expandFromBottom
props to READMEAccordion
Adds renderSectionTitle
prop https://github.com/oblador/react-native-collapsible/commit/555646957700589c88b9b9e109df14cdf7d75762 @jeffreymendez1993Accordion
Adds expandFromBottom
prop https://github.com/oblador/react-native-collapsible/commit/85bade33866704b4119e81789c04b9e68cb6ed93 @iRoachieCollapsible
Re-measure the height of the content correctly when layout changes https://github.com/oblador/react-native-collapsible/commit/117f7a161a3283f27ec5f0ce1b538611d9a82a37 @eduardomoroniAccordion
Friendlier error when passing in invalid sections
prop @iRoachiedisabled
prop on Accordion https://github.com/oblador/react-native-collapsible/commit/323c810c999c5d41c72eb6a92745e6c5d649504e @iRoachieViewPropTypes
to avoid warnings in [email protected] and above https://github.com/oblador/react-native-collapsible/pull/103/commits/960fd76ab8317b78ce72fe4767273738fec38f5f