Drawer Navigator
Last updated
Last updated
A drawer navigator is a navigation pattern commonly used in mobile app design. It features a hidden panel of navigation options accessed by swiping in from the side of the app’s screen.
Offers additional navigation options in a hidden panel. This declutters the main screen and improves the overall navigation experience by providing quick and convenient access to relevant content.
The main screen of the app remains clean and focused on the primary content. Secondary options are tucked away in the drawer, reducing visual clutter.
In this tutorial, we'll explore the benefits of using a drawer navigator and provide step-by-step instructions on implementation.
To add a navigator to your app:
Click the dropdown arrow at the top of your component tree.
Hover over Add Navigator.
Select the navigator you want to add.
Within the component tree, drag and drop screens to nest them under the drawer navigator component.
Click on the drawer navigator in the component tree to access the navigator’s properties panel. Here, on the right side, you can customize the properties specific to the navigator.
To access the properties panel for a specific screen, click the screen name in the component tree.
Center: The image is displayed at its original size within the container, and it is centered both vertically and horizontally. This means that if the image is larger than the container, parts of it may extend beyond the container's edges.
Cover: The image is resized to completely cover the container while maintaining its aspect ratio. This mode ensures that the entire container is filled with the image, and any excess image parts are cropped if necessary. This can result in parts of the image being clipped.
Contain: The image is resized to fit entirely within the container while maintaining its aspect ratio. This mode ensures that the entire image is visible within the container, and it may result in empty space around the image if the container's aspect ratio differs from the image's aspect ratio.
Repeat: The image is tiled or repeated to fill the entire container, both horizontally and vertically. This mode is often used for creating patterns or backgrounds that seamlessly repeat across the container.
Stretch: The image is resized to fully cover the container without maintaining its original aspect ratio. This can distort the image and may result in an unnatural appearance, so it's generally not recommended for most scenarios.
Screens within a navigator have an additional section in the screen's properties panel for navigation options. This is where you define the screen's label that displays in the navigator.
The status bar is located at the top of a phone's screen. The status bar displays information regarding signal strength, battery, and whether or not things like the alarm or wi-fi are enabled.
You can also trigger the drawer menu by clicking a button or image.
To create a hamburger menu:
Add your screens to the Drawer Navigator.
Add an image component to a screen.
Use copy-and-paste keyboard shortcuts to duplicate it on the other screens.
Navigate to the Blocks tab.
Click the image name in the component tree.
Drag and drop the “when image click” block into the workspace.
Click the screen name in the component tree.
Drag the “call screen’s ToggleDrawerMenu” block and nest it within the "when image click" block.
Use copy-and-paste keyboard shortcuts to duplicate this block combination on the other screens, and update the dropdowns for each screen.
This is also covered in the video tutorial: How to Use the Thunkable Drawer Navigator.
Property | Value | Description |
---|---|---|
Property | Value | Description |
---|---|---|
Property | Value | Description |
---|---|---|
Property | Value | Description |
---|---|---|
Drawer Width
Number in pixels
The width of the drawer in pixels. By default, this is 280 pixels for phones and 320 pixels for tablets.
Drawer Position
left or right
The position the drawer enters the screen from.
Active Tint Color
Color
Set the text color for the drawer label the user is currently engaging with.
Active Background Color
Color
Set the background color for the drawer label the user is currently engaging with.
Inactive Tint Color
Color
Set the text color for the drawer labels the user is not engaged with.
Inactive Background Color
Color
Set the background color for the drawer labels the user is not engaged with.
Scrollable
True/False
Allow the user to scroll on this screen.
Background Color
Color
Set the screen's background color.
Background Image
Image
Upload an image to be displayed in the screen's background. Accepted formats: PNG, JPG, GIF, SVG, etc., or a URL that ends in a file extension (e.g. https://thunkable.com/static/media/logo.ba96eb83.png)
Background Image Resize Mode
cover, contain, stretch, repeat, or center
Set how the background image is shown if the image file and the screen have different dimensions/aspect ratios. See Picture Resize Mode below.
Orientation (iOS and Android only)
portrait, landscape, or auto
Define the screen's orientation.
Drawer Label
Text
Set the text of this screen's label in the drawer navigator.
Visibility
True/False
Set whether or not you want the status bar visible on the screen.
Style
default, light-content, or dark-content
Set whether the the app's appearance should be light or dark, or follow the device's settings (default). Default is recommended.
Color (Android only)
Color
Set the color of the status bar.
Translucent (Android only)
True/False
Set the translucency of the status bar. When set to true, the app's content behind the status bar is partially visible, giving the impression that the status bar is overlaid on top of the underlying screen content rather than fully opaque.