import * as React from "react"; import { View, ViewStyle, StyleSheet, StyleProp, TextStyle, } from "react-native"; import ListSubheader from "./ListSubheader"; import { DefaultTheme } from "styled-components"; type Props = React.ComponentPropsWithRef & { /** * Title text for the section. */ title?: string; /** * Content of the section. */ children: React.ReactNode; /** * @optional */ theme?: DefaultTheme; /** * Style that is passed to Title element. */ titleStyle?: StyleProp; style?: StyleProp; }; /** * A component used to group list items. * *
* *
* * ## Usage * ```js * import * as React from 'react'; * import { ListItem } from 'react-native-simple-elements/components/List'; * * const MyComponent = () => ( * * Some title * } /> * } * /> * * ); * * export default MyComponent; * ``` */ const ListSection = ({ children, title, titleStyle, style, ...rest }: Props) => ( {title && {title}} {children} ); ListSection.displayName = "List.Section"; const styles = StyleSheet.create({ container: { marginVertical: 8, }, }); export default ListSection;