A basic Atlassian navigation.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation } from '@atlaskit/atlassian-navigation/atlassian-navigation';
import { PrimaryButton } from '@atlaskit/atlassian-navigation/primary-button';
import { PrimaryDropdownButton } from '@atlaskit/atlassian-navigation/primary-dropdown-button';
import { ProductHome } from '@atlaskit/atlassian-navigation/product-home';
import { AtlassianIcon } from '@atlaskit/logo/atlassian-icon';
import { AtlassianLogo } from '@atlaskit/logo/atlassian/logo';
const AtlassianProductHome = () => <ProductHome icon={AtlassianIcon} logo={AtlassianLogo} />;
const DefaultExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
primaryItems={[
<PrimaryButton>Your work</PrimaryButton>,
<PrimaryDropdownButton>Work items</PrimaryDropdownButton>,
<PrimaryDropdownButton>Projects</PrimaryDropdownButton>,
<PrimaryButton>Repositories</PrimaryButton>,
]}
renderProductHome={AtlassianProductHome}
/>
);
export default DefaultExample;
Show more Add top-level navigation items using PrimaryButton.
Explore
Work items
Services
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, PrimaryButton } from '@atlaskit/atlassian-navigation';
const PrimaryButtonExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
primaryItems={[
<PrimaryButton>Explore</PrimaryButton>,
<PrimaryButton>Work items</PrimaryButton>,
<PrimaryButton>Services</PrimaryButton>,
]}
/>
);
export default PrimaryButtonExample;
Show more Add menu items to a primary button using the PrimaryDropdownButton component.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, PrimaryDropdownButton } from '@atlaskit/atlassian-navigation';
const PrimaryDropdownExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
primaryItems={[
<PrimaryDropdownButton>Explore</PrimaryDropdownButton>,
<PrimaryDropdownButton>Work items</PrimaryDropdownButton>,
<PrimaryDropdownButton>Services</PrimaryDropdownButton>,
]}
/>
);
export default PrimaryDropdownExample;
Show more The navigation bar is divided into two areas (primary and secondary) and several sections.
The primary area shows the app switcher first, followed by the product home logo, dropdown
buttons, and the call to action button (Create). The secondary area — on the opposite side — can contain a search bar, notification button, help
button, settings icon, and user profile actions. The AppHome component displays a visual identity composed of an app logo icon, the name of the
app, and additional optional text. The name is hidden when space is restricted. This
component replaces the ProductHome component for all Atlassian apps.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AppHome, AtlassianNavigation } from '@atlaskit/atlassian-navigation';
import { JiraIcon } from '@atlaskit/logo';
const ExampleHome = () => (
<AppHome
href="#"
siteTitle="Hello"
icon={JiraIcon}
name="Jira"
aria-label="Visit Jira homepage"
/>
);
const ProductHomeExample = (): React.JSX.Element => (
<AtlassianNavigation label="site" renderProductHome={ExampleHome} primaryItems={[]} />
);
export default ProductHomeExample;
Show more The ProductHome component is similar to AppHome, but accepts a separate logo and icon, and
optional text. The component swaps from displaying the logo to the icon when space is
restricted.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, ProductHome } from '@atlaskit/atlassian-navigation';
import { AtlassianIcon } from '@atlaskit/logo/atlassian-icon';
import { AtlassianLogo } from '@atlaskit/logo/atlassian/logo';
const ExampleHome = () => (
<ProductHome href="#" siteTitle="Hello" icon={AtlassianIcon} logo={AtlassianLogo} />
);
const ProductHomeExample = (): React.JSX.Element => (
<AtlassianNavigation label="site" renderProductHome={ExampleHome} primaryItems={[]} />
);
export default ProductHomeExample;
Show more Use CustomProductHome to provide a custom logo and icon with URLs. Custom logos have a default max
width of 260px, but this can be overridden with the logoMaxWidth prop.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, CustomProductHome } from '@atlaskit/atlassian-navigation';
import customIcon from '../shared/assets/atlassian-icon.png';
import customLogo from '../shared/assets/custom-logo-wide.png';
const CustomHome = () => (
<CustomProductHome
href="#"
iconAlt="Atlassian documentation home"
iconUrl={customIcon}
logoAlt="Atlassian documentation home"
logoUrl={customLogo}
logoMaxWidth={300}
/>
);
const CustomHomeExample = (): React.JSX.Element => (
<AtlassianNavigation label="site" renderProductHome={CustomHome} primaryItems={[]} />
);
export default CustomHomeExample;
Show more To show the app switcher in the Atlassian navigation, use the renderAppSwitcher prop with the
AppSwitcher component.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AppSwitcher, AtlassianNavigation } from '@atlaskit/atlassian-navigation';
const DefaultAppSwitcher = () => <AppSwitcher tooltip="Switch to..." />;
const AppSwitcherExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
renderAppSwitcher={DefaultAppSwitcher}
primaryItems={[]}
/>
);
export default AppSwitcherExample;
Show more Use the Create component to add a call to action button which is shown after all primary buttons.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, Create, ProductHome } from '@atlaskit/atlassian-navigation';
import { JiraIcon, JiraLogo } from '@atlaskit/logo';
const CreateButton = () => (
<Create
buttonTooltip="Create a new page"
iconButtonTooltip="Create a new page"
text="Create"
href="#"
/>
);
const Home = () => <ProductHome icon={JiraIcon} logo={JiraLogo} />;
const CreateButtonExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={Home}
renderCreate={CreateButton}
primaryItems={[]}
/>
);
export default CreateButtonExample;
Show more Use the Profile component to add a profile button which takes an icon/avatar component.
Atlassian account: Emil Rottmayer Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, Profile } from '@atlaskit/atlassian-navigation';
import Avatar from '@atlaskit/avatar/avatar';
const avatarUrl =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAALXUlEQVRYhX2U2Xcb9J1H/V90Ch0ODQECYZuWmSnQFkpnOoWeOXM6DQQOMDSBEsgC2XHInonjxI4T2/G+27JlLda+WoslS5YsWbZWb/Ii2dptx/ES2+nbnYdgNxOgD/fh93Tv53zP+eVt/PUe6/c2vp+NDdY31llfv8/a2horKysMePpRSMUYtWqGIyGWl++wsrLEysoSy8t3WFpaZHFxgcXFBRYW5ra4vZhjf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KBHL3MiKxdgVpiQNwsRlAvRCc3U15ciUQgp6NJRNm1cvK87hA6mRFRq5R+xxA2XS8WpRmzopu+ngH67UM4jU6MXQZ0UgNmrR2b3omiQ031zVoUIh3KTg2yNgVGuRm5QI5WrKVbaUYl1KD5NkBY34FObqaqtBGZUI2gTkjRxavkuZwBxG0KFGI1/TYfJrUVTacGl9mN2z6Iw9iHTW1FI1Sjl5lxmD2oRDoqS2pQSfSYtXaUQjWqTg0mpYWuli4MXUZMSgtqkRadzIyoWUJLeQM6pZXmagFSgZLGylYunbpAXpdIh1pqRNAgwmbow6bvRSvW4e7x0aN1oOpQY5KbsGpsOEz9GLqMVF6rRCZQoFfZMKptyNtVqIRa9FIDyg4VRpkRk7IHrdhAt8JKW3U7jRXNKEV6SgrKkTRKqL5Rx9ljp/k/7mfNLrZFIgIAAAAASUVORK5CYII=';
const onClick = (...args: any[]) => {
console.log('profile click', ...args);
};
const DefaultProfile = () => (
<Profile
icon={<Avatar size="small" src={avatarUrl} name="Atlassian account: Emil Rottmayer" />}
onClick={onClick}
tooltip="Your profile and settings"
/>
);
const ProfileExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
renderProfile={DefaultProfile}
primaryItems={[]}
/>
);
export default ProfileExample;
Show more Use the Search component to add a search input field to the navigation.
Edit in code sandbox (opens in a new window) import React, { useState } from 'react';
import { AtlassianNavigation, Search } from '@atlaskit/atlassian-navigation';
const SearchExample = (): React.JSX.Element => {
const DefaultSearch = () => {
const [value, setValue] = useState('');
const onChange = (event: any) => {
console.log('search clicked with value: ', event.target.value);
setValue(event.target.value);
};
return (
<Search
onClick={onChange}
placeholder="Search..."
tooltip="Search"
label="Search"
value={value}
/>
);
};
return (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
renderSearch={DefaultSearch}
primaryItems={[]}
/>
);
};
export default SearchExample;
Show more Use the Settings component to add a settings button.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, Settings } from '@atlaskit/atlassian-navigation';
const DefaultSettings = () => <Settings tooltip="Product settings" />;
const SettingsExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
renderSettings={DefaultSettings}
primaryItems={[]}
/>
);
export default SettingsExample;
Show more Use the SignIn component to add a sign in button.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, SignIn } from '@atlaskit/atlassian-navigation';
const DefaultSignIn = () => <SignIn href="#" tooltip="Sign in" />;
const SignInExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
renderSignIn={DefaultSignIn}
primaryItems={[]}
/>
);
export default SignInExample;
Show more Use the Help component to add a help button.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, Help } from '@atlaskit/atlassian-navigation';
const HelpButtonExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
renderHelp={() => <Help tooltip="Get help" />}
primaryItems={[]}
/>
);
export default HelpButtonExample;
Show more Use the Notifications component to add a notifications button with an indicator.
Edit in code sandbox (opens in a new window) import React from 'react';
import { AtlassianNavigation, Notifications } from '@atlaskit/atlassian-navigation';
import { NotificationIndicator } from '@atlaskit/notification-indicator';
const NotificationsBadge = () => (
<NotificationIndicator
onCountUpdated={console.log}
notificationLogProvider={Promise.resolve({}) as any}
/>
);
const NotificationsExample = (): React.JSX.Element => (
<AtlassianNavigation
label="site"
renderProductHome={() => null}
renderNotifications={() => <Notifications badge={NotificationsBadge} tooltip="Notifications" />}
primaryItems={[]}
/>
);
export default NotificationsExample;
Show more Atlassian navigation buttons extend all props from
@atlaskit/button/custom-theme-button.
This includes the component prop, which allows you to pass in a custom element to render, such as
the <Link> component from popular routing libraries.
import Link from '@popular/routing-library';
import { PrimaryButton } from '@atlaskit/atlassian-navigation';
// Set a custom component
<PrimaryButton component={Link}>Your Work</PrimaryButton>;If there are too many menu items to display on small viewports the overflowing items should collapse
into a dropdown menu.
Explore
Projects
Dashboards
Edit in code sandbox (opens in a new window)
Show more Skeleton buttons are lightweight HTML button elements with CSS used as a representation of their
heavier interactive counterparts.
These can be used when parts of the navigation are loaded dynamically. If the full navigation is
delayed, use the skeleton loader pattern below instead.
Hello
Home
Projects
Filters & work items
Dashboards
Apps
Create
Edit in code sandbox (opens in a new window) import React, { Fragment } from 'react';
import { jsx } from '@emotion/react';
import { AtlassianNavigation, ProductHome } from '@atlaskit/atlassian-navigation';
import {
SkeletonCreateButton,
SkeletonIconButton,
SkeletonPrimaryButton,
} from '@atlaskit/atlassian-navigation/skeleton';
import { SkeletonHelpButton } from '@atlaskit/atlassian-navigation/skeleton-help-button';
import { SkeletonNotificationButton } from '@atlaskit/atlassian-navigation/skeleton-notification-button';
import { SkeletonSettingsButton } from '@atlaskit/atlassian-navigation/skeleton-settings-button';
import { SkeletonSwitcherButton } from '@atlaskit/atlassian-navigation/skeleton-switcher-button';
import { JiraIcon, JiraLogo } from '@atlaskit/logo';
import { avatarUrl } from '../shared/profile-popup';
const SkeletonCreate = () => <SkeletonCreateButton text="Create"></SkeletonCreateButton>;
const SkeletonProfileButton = () => (
<SkeletonIconButton>
<img src={avatarUrl} alt="Your profile and settings" />
</SkeletonIconButton>
);
const skeletonPrimaryItems = [
<SkeletonPrimaryButton>Home</SkeletonPrimaryButton>,
<SkeletonPrimaryButton isDropdownButton text="Projects" />,
<SkeletonPrimaryButton isDropdownButton isHighlighted text="Filters & work items" />,
<SkeletonPrimaryButton isDropdownButton text="Dashboards" />,
<SkeletonPrimaryButton isDropdownButton text="Apps" testId="apps-skeleton" />,
];
const AtlassianNavigationSkeletonButtons = (): React.JSX.Element => {
return (
<Fragment>
<AtlassianNavigation
label="site"
moreLabel="More"
primaryItems={skeletonPrimaryItems}
renderAppSwitcher={() => <SkeletonSwitcherButton label="switcher button" />}
renderCreate={SkeletonCreate}
renderProductHome={() => <ProductHome icon={JiraIcon} logo={JiraLogo} siteTitle="Hello" />}
renderProfile={SkeletonProfileButton}
renderSettings={() => <SkeletonSettingsButton label="settings button" />}
renderHelp={() => <SkeletonHelpButton label="help button" />}
renderNotifications={() => <SkeletonNotificationButton label="notifications button" />}
testId="atlassian-navigation"
/>
</Fragment>
);
};
export default AtlassianNavigationSkeletonButtons;
Show more Use loading skeletons to reduce the perceived loading time of heavier full-page experiences.
Edit in code sandbox (opens in a new window) import React from 'react';
import { jsx } from '@emotion/react';
import { NavigationSkeleton } from '@atlaskit/atlassian-navigation/skeleton';
const InteractiveSkeletonExample = (): React.JSX.Element => {
return (
<NavigationSkeleton primaryItemsCount={2} secondaryItemsCount={1} shouldShowSearch={true} />
);
};
export default InteractiveSkeletonExample;
Show more