# 3.4 Tab Navigation

To improve the user experience of our app, we want to add tabs on the main page. One tab will show all pending tasks, while the other one will show the completed tasks.

### Step 1: Add Tab Navigator

It is possible to add nested routes in BlueBase. Whenever we want to do this, we will add a `navigator` property in the route. There are several navigators available to use (i.e. `switch`, `stack`, `tab`, `bottom-tabs`, `drawer`).

Inside the navigator, we add our desired routes:

{% code title="" %}

```jsx
{
	name: 'TasksApp',
	screen: Noop,
	path: '',
	exact: false,
	
	options: {
		title: 'My Tasks',
		headerRight: () => <TaskCreateButton />
	},
	
	navigator: {
		headerMode: 'none',
		type: 'tab',
	
		routes: [{
			exact: true,
			name: 'PendingTask',
			path: 'pending',
			screen: 'PendingTasksScreen',

			options: {
				title: 'Pending',
			},
		}, {
			exact: true,
			name: 'CompletedTasks',
			path: 'completed',
			screen: 'CompletedTasksScreen',

			options: {
				title: 'Completed',
			},
		}],
	},
}
```

{% endcode %}

When you run the app, you should now see 2 tabs on the main page like the screenshots below:

![Web](/files/QbTCy8rDC35StsgmE2IV) ![iOS](/files/c1u76lskfxYTcOG57XyT)

### Step 2: Tab Icons

Another thing we can do to make our UI pleasing is by adding icons to our tabs. This is done by:

* Adding `tabBarIcon` to `route.options`.
* Adding `tabBarOptions` to the `navigator`.

See the code below for example:

{% code title="src/routes.ts" %}

```jsx
{
	name: 'TasksApp',
	screen: Noop,
	path: '',
	exact: false,
	
	options: {
		title: 'My Tasks',
		headerRight: () => <TaskCreateButton />
	},
	
	navigator: {
		headerMode: 'none',
		type: 'tab',
	
		routes: [{
			exact: true,
			name: 'PendingTask',
			path: 'pending',
			screen: 'PendingTasksScreen',

			options: {
				title: 'Pending',
				tabBarIcon: ({ color }) => <Icon name="checkbox-multiple-blank-outline" color={color} />,
			},
		}, {
			exact: true,
			name: 'CompletedTasks',
			path: 'completed',
			screen: 'CompletedTasksScreen',

			options: {
				title: 'Completed',
				tabBarIcon: ({ color }) => <Icon name="checkbox-multiple-marked" color={color} />,
			},
		}],
	
		tabBarOptions: {
			showIcon: true,
			tabStyle: {
				flexDirection: 'row',
			},
		},
	},
}
```

{% endcode %}

![Web](/files/UwYzWaGcyhq08NFbuXQP) ![iOS](/files/UE0LFxBsLKwGrU0SQ5dT)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bluebase.gitbook.io/core/tutorial/2.-create-screens/3.4-tab-navigation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
