> For the complete documentation index, see [llms.txt](https://bluebase.gitbook.io/core/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bluebase.gitbook.io/core/tutorial/2.-create-screens/3.3-task-create-screen.md).

# 3.3 Task Create Screen

We also need a screen to create a new task.

### Step 1: Create Route

Similar to the previous section, now we create our third route. Notice that I have now moved the routes array dedicated file, to keep to code readable.

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

```typescript
export const routes = [
{
	name: 'CreateTask',
	screen: 'CreateTaskScreen',
	path: 'create',
	exact: true,

	options: {
		title: 'Create Task',
	},
},
{
	name: 'EditTask',
	screen: 'EditTaskScreen',
	path: 't/:taskId',
	exact: true,

	options: {
		title: 'Edit Task',
	},
},
{
	name: 'TasksApp',
	screen: 'PendingTasksScreen',
	path: '',
	exact: false,

	options: {
		title: 'My Tasks',
	},
}];
```

{% endcode %}

Import this array to your plugin file:

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

```typescript
import { createPlugin } from '@bluebase/core';

import { ToDoAppIcon } from './components/ToDoAppIcon';
import { routes } from './routes';
import { screens } from './screens';

export default createPlugin({
	key: 'tasks',
	name: 'Tasks',
	description: 'A todo app made with BlueBase framework.',

	components: {
		// Components
		ToDoAppIcon,

		// Screens
		...screens,
	},

	icon: {
		component: 'ToDoAppIcon',
		type: 'component',
	},

	indexRoute: 'TasksApp',

	routes,
});

```

{% endcode %}

This should create the third route, which should be accessible via the following URL:

```
http://localhost:19006/p/tasks/create
```

### Step 2: Create a Button to Navigate

But we still need a way to navigate to this route in our UI. This time we will add an icon button in the header.

Create the following component:

{% code title="src/components/TaskCreateButton/TaskCreateButton.tsx" %}

```typescript
import { IconButton } from '@bluebase/components';
import { useNavigation, useTheme } from '@bluebase/core';
import React, { useCallback } from 'react';

export interface TaskCreateButtonProps {}

export const TaskCreateButton = (_props: TaskCreateButtonProps) => {
	const { theme } = useTheme();
	const { navigate } = useNavigation();

	const onPress = useCallback(() => {
		navigate('CreateTask');
	}, []);

	return (
		<IconButton
			name="plus"
			onPress={onPress}
			color={theme.palette.text.secondary}
		/>
	);
};
```

{% endcode %}

Also, create an index file to export the component:

{% code title="src/components/TaskCreateButton/index.ts" %}

```typescript
export * from './TaskCreateButton';

import { TaskCreateButton } from './TaskCreateButton';
export default TaskCreateButton;
```

{% endcode %}

### Step 3: Add Button in Header

To add our new `TaskCreateButton` to the screen, add the `headerRight` property in the route options like so:

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

```jsx
{
	name: 'TasksApp',
	screen: 'PendingTasksScreen',
	path: '',
	exact: false,

	options: {
		title: 'My Tasks',
		headerRight: () => <TaskCreateButton />
	},
}
```

{% endcode %}

That's it, run your app to test it out.

![](/files/DLRIv9w8foivJkfQVfyQ) ![](/files/Fek4QgdhWXk6cONIfkdo)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.3-task-create-screen.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.
