UNPKG

react-native-paper

Version:
64 lines 1.67 kB
import * as React from 'react'; import { StyleProp, View, ViewStyle } from 'react-native'; import type { ThemeProp } from '../../types'; export declare type Props = React.ComponentPropsWithRef<typeof View> & { /** * Title to show as the header for the section. */ title?: string; /** * Content of the `Drawer.Section`. */ children: React.ReactNode; /** * Whether to show `Divider` at the end of the section. True by default. */ showDivider?: boolean; style?: StyleProp<ViewStyle>; /** * @optional */ theme?: ThemeProp; }; /** * A component to group content inside a navigation drawer. * * <div class="screenshots"> * <figure> * <img class="small" src="screenshots/drawer-section.png" /> * </figure> * </div> * * ## Usage * ```js * import * as React from 'react'; * import { Drawer } from 'react-native-paper'; * * const MyComponent = () => { * const [active, setActive] = React.useState(''); * * return ( * <Drawer.Section title="Some title"> * <Drawer.Item * label="First Item" * active={active === 'first'} * onPress={() => setActive('first')} * /> * <Drawer.Item * label="Second Item" * active={active === 'second'} * onPress={() => setActive('second')} * /> * </Drawer.Section> * ); * }; * * export default MyComponent; * ``` */ declare const DrawerSection: { ({ children, title, theme: themeOverrides, style, showDivider, ...rest }: Props): JSX.Element; displayName: string; }; export default DrawerSection; //# sourceMappingURL=DrawerSection.d.ts.map