---
title: Top nav items
description: Buttons and elements for the top nav.
order: 1
---

import SectionMessage from '@atlaskit/section-message';

import { TopNavStartLayoutExample } from '../../examples/constellation/top-nav-items/top-nav-start';
import { TopNavStartToggleExample } from '../../examples/constellation/top-nav-items/top-nav-start-toggle';
import { TopNavMiddleLayoutExample } from '../../examples/constellation/top-nav-items/top-nav-middle';
import { AskRovoExample } from '../../examples/constellation/top-nav-items/ask-rovo';
import { AppLogoExample } from '../../examples/constellation/top-nav-items/app-logo';
import { AppLogoSecondaryNameExample } from '../../examples/constellation/top-nav-items/app-logo-secondary-name';
import { CustomAppSwitcherExample } from '../../examples/constellation/top-nav-items/custom-app-switcher';
import { CustomLogoExample } from '../../examples/constellation/top-nav-items/custom-logo';
import { CustomThemingLogoExample } from '../../examples/constellation/top-nav-items/custom-theming--logo';
import { CustomThemingSearchExample } from '../../examples/constellation/top-nav-items/custom-theming--search';
import { CustomThemingButtonsExample } from '../../examples/constellation/top-nav-items/custom-theming--buttons';
import { EndItemExample } from '../../examples/constellation/top-nav-items/end-item';
import { TopNavButtonExample } from '../../examples/constellation/top-nav-items/top-nav-button';
import { CustomTitleExample } from '../../examples/constellation/top-nav-items/custom-title';

These components can be used within the top nav from
[layout](/components/navigation-system/layout/examples).

For Atlassian apps,
[Global top navigation (Atlassians only)](https://atlaskit-website-bifrost.stg-east.frontend.public.atl-paas.net/packages/navigation/global-top-navigation)
provides a shared top nav built on Atlassian Design System components. See its documentation for
configuration and integration guidance.

## Start items

These actions go in the [top nav start](/components/navigation-system/layout/examples#top-nav-slots)
area. They are left-aligned in the following order:

- Side nav toggle button: Opens and closes the
  [side nav](/components/navigation-system/layout/examples#side-nav).
- App switcher: Opens and closes an app switcher.

Use one of the following logo components to orient users and provide a persistent link to the app
landing page:

- [App logo](#app-logo): A container for an app’s [logo icon](/components/logo) and name.
- [Custom logo](#custom-logo): A container for custom logo images.
- [Custom title](#custom-title): Optional text used for app customisation by customers.

<Example Component={TopNavStartLayoutExample} />

### App switcher

App switcher opens the app switcher menu. By default, it uses the Atlassian app switcher icon.

Use the optional `icon` prop to replace the default icon with a custom visual, such as a product
logo. Continue to provide a meaningful `label` so the custom visual has an accessible name.

<Example Component={CustomAppSwitcherExample} />

### Side nav toggle button

The side nav toggle button must be passed to `TopNavStart` through the `sideNavToggleButton` prop,
not via `children`.

- When the keyboard shortcut is enabled, the toggle button’s tooltip will automatically show
  `Ctrl+[` as the shortcut.
- The toggle button appears before the app switcher and logo, whether the side nav is collapsed or
  expanded.

<Example Component={TopNavStartToggleExample} />

### App logo

App logo displays an app [logo icon](/components/logo) and name.

- It has a maximum width of 320px, after which the app name truncates.
- At container widths below 1,024px, the app name is not shown.

See the [responsive section](#responsive) for more information.

<Example Component={AppLogoExample} />

#### Secondary name

Use the optional `secondaryName` prop to add supporting context below the app name, such as the
current experience or workspace. The supporting context is hidden with the app name at container
widths below 1,024px.

<Example Component={AppLogoSecondaryNameExample} />

### Custom logo

Custom logo provides a container for custom logo images with the following constraints:

- Maximum width: 320px. If the image is wider than this, the logo will scale down to fit.
- Maximum height: 24px. If the image is shorter than this, the logo will scale up to fit.

Do not provide explicit width and height values on the image, otherwise it will not respect the
container size.

At container widths below 1,024px, only the provided icon is shown. At container widths of 1,024px
and above, the provided logo is shown.

See the [responsive section](#responsive) for more information.

<Example Component={CustomLogoExample} />

### Custom title

Optional text used for app customization by customers.

- When present, it appears to the right of the logo.
- It has a maximum width of 200px, after which the text truncates.
- At container widths below 1,024px, the custom title is not displayed.

<Example Component={CustomTitleExample} />

## Middle items

These actions go in the
[top nav middle](/components/navigation-system/layout/examples#top-nav-slots) area.

- They should consist of a search component and a create component, in that order to maintain the
  correct layout behavior.
- The actions are center-aligned.
- We have provided placeholder components.
- Our placeholder search field scales to fill the available space, up to a maximum width of 680px.
  At container widths below 480px, it displays as an icon button.
- Our placeholder create button displays as an icon button at container widths below 768px.

See the [responsive section](#responsive) for more information. If you use search or create
components from other packages, you may experience different responsive behavior.

<SectionMessage>

The search bar must be the first child of `TopNavMiddle`, in line with our design specifications.
Otherwise, you may see unexpected layout behavior.

</SectionMessage>

<Example Component={TopNavMiddleLayoutExample} />

## End items

These actions appear in the
[top nav end](/components/navigation-system/layout/examples#top-nav-slots) area. They are
right-aligned and provided as a list for accessibility. They appear in the following order:

- Growth button: A placeholder for an upselling button (optional).
- Notifications: Use to open and close notifications.
- Help: Use to open and close help.
- Settings: Use to open and close a settings menu.
- Profile/Login: A placeholder for an account component.
- Ask Rovo: Use to open Rovo Chat in chat panel.

At container widths below 768px, the other end items move into the More menu. Ask Rovo remains
outside the menu and displays as an icon button.

Apps must wire up Ask Rovo to open chat panel and manage the button’s visibility based on chat panel
state. Hide the button while chat panel is open and show it again when chat panel closes.

See the [responsive section](#responsive) for more details.

### Ask Rovo

Use Ask Rovo to open Rovo Chat in the
[chat panel](/components/navigation-system/layout/examples#chat-panel).

- Place it after the other end items using `ResponsiveTopNavButton` in the `persistentItems` prop on
  `TopNavEnd`. This keeps it outside the More menu.
- At top nav container widths below 768px, it displays as an icon button.
- Hide it while chat panel is open, and show it again when chat panel closes. Your app manages this
  visibility and the panel’s open state.

Wrap the button in a list item within an accessible list. When hiding the button, remove the
containing list too, so it doesn’t leave an empty group.

The example below moves focus to the close button when chat opens. When chat closes, it returns
focus to Ask Rovo if focus is still inside chat panel.

To adapt the example, supply your app’s navigation, page content, and chat content through its
props. Connect your chat’s close action to `closeChat`, and pass the same handler to
`ChatPanel.onClose`.

<SectionMessage>

The `persistentItems` behavior is enabled behind the `platform-dst-chat-panel-layout` feature flag.

</SectionMessage>

<Example Component={AskRovoExample} appearance="source-only" isCodeSandboxDisabled />

### End item

If none of the provided end items are suitable, you can create your own icon button using `EndItem`.

If you need a more customized button, use [top nav button](#top-nav-button) and wrap it in a list
item.

<Example Component={EndItemExample} />

## Top nav button

A button component that supports theming. The following variants are available:

- Top nav icon button
- Top nav link button
- Top nav link icon button
- Top nav button

Use this component when you need to add buttons to the top nav. Be aware that adding custom buttons
may negatively impact the consistency across apps.

<Example Component={TopNavButtonExample} />

## Responsive

Top nav items respond to the width of the top nav container. An inline chat panel reduces the space
available to top nav, so responsive changes can occur without a change in viewport size.

The table shows the behavior of the placeholder components. Search and create components from other
packages may have different responsive behavior.

| Container width   | Start items | Middle items                        | End items                            |
| ----------------- | ----------- | ----------------------------------- | ------------------------------------ |
| 320–479px         | Logo icon   | Search and create icon buttons      | More button and Ask Rovo icon button |
| 480–767px         | Logo icon   | Search field and create icon button | More button and Ask Rovo icon button |
| 768–1,023px       | Logo icon   | Search field and create button      | End items shown individually         |
| 1,024–1,439px     | Logo lockup | Search field and create button      | End items shown individually         |
| 1,440–1,767px     | Logo lockup | Search field and create button      | End items shown individually         |
| 1,768px and above | Logo lockup | Search field and create button      | End items shown individually         |

Ask Rovo is hidden while chat panel is open at every container width.

Explore the
[interactive example](https://atlaskit.stg.atlassian.com/examples/navigation/global-top-navigation/self-hiding-chat)
to see how an inline chat panel affects top nav.

## Custom theming

Custom theming is configured on the
[top nav](/components/navigation-system/layout/examples#top-nav).

### Logos

Logos and icons from the [logo](/components/logo) package will automatically consume the theme when
used with the `AppLogo` or `CustomLogo` component.

Custom logos uploaded by organization admins are not affected by theming.

<Example Component={CustomThemingLogoExample} />

### Search

Use the `useLegacySearchTheme()` hook to obtain a theme value that is compatible with existing
Search Platform components.

<SectionMessage appearance="warning" title="Use sparingly">

Do not create new components that rely on the `useLegacySearchTheme()` hook. It is intended only for
backwards compatibility, and may be deprecated if the Search Platform evolves.

</SectionMessage>

<Example Component={CustomThemingSearchExample} />

### Buttons

Do not use [button](/components/button) inside of the top navigation.

Use the action components exported from this package (such as `AppSwitcher`), as they automatically
consume the custom theme.

Custom actions can be created using [end item](#end-item) for icon buttons and
[top nav button](#top-nav-button) for buttons with visible text.

<Example Component={CustomThemingButtonsExample} />
