Pro component
Requires all-access to use the source code
Unlock All Pro Screens & Components
Elevate your app with powerful, native-feeling components and templates. Build faster with beautiful ready-to-use designs.
import {
DrawerContentRoot,
DrawerContentSection,
DrawerContentSectionItem,
DrawerContentSectionTitle,
getActiveDrawerContentScreen,
useToggleDrawer,
} from '~/components/nativewindui/DrawerContent';
<DrawerContentRoot navigation={props.navigation}>
<DrawerContentSectionTitle type="large">Section Title</DrawerContentSectionTitle>
<DrawerContentSection>
<DrawerContentSectionItem isActive label="Item 1" />
<DrawerContentSectionItem label="Item 2" />
</DrawerContentSection>
<DrawerContentSectionTitle>Section Title 2</DrawerContentSectionTitle>
<DrawerContentSection>
<DrawerContentSectionItem label="Item 3" />
<DrawerContentSectionItem label="Item 4" />
</DrawerContentSection>
</DrawerContentRoot>
DrawerContentRoot
Inherits all the props from React Native's View component.
Prop | Type | Description |
---|---|---|
actions | React.ReactNode | Actions to be displayed in the drawer content. |
DrawerContentSectionTitle
Inherits all the props from NativeWindUI's Text component except for the variant prop.
Prop | Type | Default | Description |
---|---|---|---|
type | 'large' | 'default' | default | The type of the section title. |
DrawerContentSection
Inherits all the props from React Native's View component.
DrawerContentSectionItem
Prop | Type | Default | Description |
---|---|---|---|
icon | IconProps<'sfSymbol' | 'material'> | The icon to be displayed. | |
label | string | The label to be displayed. | |
onPress | () => void | The function to be called when the item is pressed. | |
isActive | boolean | false | Whether the item is active. |
rightView | React.ReactNode | The view to be displayed on the right of the item. |
useToggleDrawer
: A hook to toggle the drawer.
getActiveDrawerContentScreen
: A function to get the active drawer content screen.