peacechen / react-native-modal-selector

A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.
MIT License
369 stars 129 forks source link

Add prop for rendering a header above the list #170

Closed asdolo closed 3 years ago

asdolo commented 3 years ago

This PR adds a new optional prop that can be used to render a fixed header above the list.

Here's an example of what can be achieved:

<ModalSelector
  ...
  header={
    <View style={styles.header}>
      <Text variant="body-bold">What kind of facility is?</Text>
      <Text color="gray-4" variant="small">
        Please, select an option
      </Text>
    </View>
  }
/>

header

mikaello commented 3 years ago

Thanks for your contribution :-)

Could you:

?

asdolo commented 3 years ago

Done! 🙂 @mikaello

mikaello commented 3 years ago

Thanks, @asdolo !

Published to NPM as version 2.1.0:

image

https://www.npmjs.com/package/react-native-modal-selector/v/2.1.0