Skip to main content

SidePanel

The side panel is the main navigation for the new Adjust platform design. In terms of visual hierarchy, it is on top of all other regular content or components on the page. Modal dialogs may overlay the side panel.

Example

Live Editor
Result
Loading...

Variant

Agency Users

AgencyUser renders menu action of Agency User. It includes 2 sub component: MenuHeader and MenuItem

Live Editor
Result
Loading...

Loading & Error state

Side Panel supports loading state with prop isLoading in NavSection sub component. And it also supports to display a badge for error messages if any problems happen with ErrorState sub component in footer area.

Live Editor
Result
Loading...

Sub Components

The navigation component is based on two sub-components (NavSection and NavItem) and is responsible for rendering Navigation items in the proper place with the proper styles.

The NavSection component is used for rendering the first-level navigation elements.

NameTypeDescription
idstringProp to provide a unique ID to the component.
titlestringProp to provide nav section title value
brand"datascape", "pulse", "campaign_lab", "dataworks", "appview", ...Prop to provide a brand icon
isActivebooleanProp to define the active section.
isExpandedbooleanProp to define the expanded state.
isDisabledbooleanProp to define the disabled section.
notificationCountnumberProp to define the notification badge.
asElementTypeProp to allow external link component, such as: react-router-dom Link
tostring, objectProp to define the path of external link component
onClick(id: IDtype, isExpanded: boolean) => voidA callback function to inform the parent component with the item id and expanded state on click
dataTestIdstringProp to provide to unique data-testid
childrenReactNodeProp to provide to second and third level nav items. Please use only NavItem component as a child element.

The NavItem component is used for rendering the navigation items.

NameTypeDescription
idstringProp to provide a unique ID to the component.
type'headline', headline-labeled', 'plain'Prop to identify the type of the nav item.
titlestringProp to provide item's title value.
isActivebooleanProp to define the active item.
isDisabledbooleanProp to define the disabled item.
tooltipContentstring, ReactNodeProp to define the item as the active item.
asElementTypeProp to allow external link component, such as: react-router-dom Link
tostring, objectProp to define the path of external link component
onClick(id: IDtype, type?: NavItemType) => voidA callback function to inform the parent component with the item id and the type of item
onClickToAction(id: IDtype) => voidA callback function to inform parent component with the item id on icon button (plus icon)
childrenReactNodeProp to provide to second and third level nav items. Please use only NavItem component as a child element.
dataTestIdstringProp to provide to unique data-testid to item
actionDataTestIdstringProp to provide to unique data-testid to action button

NavItem can be set as a link item:

  • Anchor element (default) by adding its attributes such as href, target, ...
  • External link component (e.g react-router-dom) by adding as and its attributes such as to, replace, ...
note

As default onClick and onClickToAction are still invoked when the link item is clicked. If not expectation, please handle these events by yourself (see above example)

import { Link } from 'react-router-dom';

const navItems = [
{
id: '1.1.1',
title: 'All Reports',
as: Link,
to: {
pathname: '/courses',
search: '?sort=name',
hash: '#the-hash'
}
},
{
id: '1.1.2',
title: 'Skan',
href: 'https://www.google.com/',
target: '_blank'
}
];

Account

The Account component is a sub component of SidePanel to render the account information and actions.

NameTypeDescription
userNamestringProp to provide user name
accountNamestringProp to provide title for the account name
tooltipTitlestringProp to provide the tooltip content
isActionMenuOpenbooleanProp to provide open state of action menu
onClickButton(isActionMenuOpen: boolean) => voidAn onClick event to overwrite the icon button's onClick.
childrenReactNodeProp to provide the content of action menu, list of MenuItem
actionReactNodeProp to provide action button for the action menu
footerActionsReactNodeProp to provide footer's action buttons for action menu
dataTestIdstringProp to provide to unique data-testid

Note: The action menu of Account is customization of IconMenu component.

AgencyUser

The AgencyUser component is a sub component of SidePanel to render the agency user information and actions.

NameTypeDescription
titlestringProp to provide title for the agency user
tooltipTitlestringProp to provide the tooltip content
onToggleMenu(isVisible: boolean) => voidA callback to inform open state of action menu.
childrenReactNodeProp to provide the content of action menu, includes: MenuHeader and list of MenuItem
dataTestIdstringProp to provide to unique data-testid

Note: The action menu of AgencyUser is a variant of IconMenu component.

LanguageSelector

The LanguageSelector component is a sub component of SidePanel to render the language section.

NameTypeDescription
activeLanguagestringProp to provide the selected language value.
tooltipTitlestringProp to provide the tooltip content
childrenReactNodeProp to provide the content of action menu, list of MenuItem
dataTestIdstringProp to provide to unique data-testid

Note: The action menu of LanguageSelector is a variant of IconMenu component.

The MenuItem is the sub component to render header of action menu in AgencyUser.

NameTypeDescription
childrenReactNodeProp to provide the content of menu header

The MenuItem is the sub component to render list items of action menu in Account, AgencyUser, LanguageSelector.

NameTypeDescription
id'string', 'number'Prop to provide id of menu item
isActivebooleanProp to provide checked state (AgencyUser, LanguageSelector)
isDisabledbooleanProp to provide disabled item
iconIconNameProp to provide icon name
childrenReactNodeProp to provide the content of menu item
onClick(id: string) => voidProp to provide a callback to inform the id of selected item
dataTestIdstringProp to provide to unique data-testid

Note: you can refer more usage here

FooterActions

The FooterActions component is a sub component of SidePanel to render the footer actions.

NameTypeDescription
tooltipTitlestringProp to provide the tooltip content
isActionMenuOpenbooleanProp to provide open state of action menu
onClickButton(isActionMenuOpen: boolean) => voidAn onClick event to overwrite the icon button's onClick.
childrenReactNodeProp to provide the content of actions, list of FooterActionItem
dataTestIdstringProp to provide to unique data-testid

FooterActionItem

The FooterActionItem is the sub component to render list of actions in FooterActions.

NameTypeDescription
idstringProp to provide id of action item
iconIconNameProp to provide icon of action item
tooltipTitlestringProp to provide the tooltip content when side panel is expanded
childrenReactNodeProp to provide the content of action item
onClick(id: string) => voidProp to provide a callback to inform the id of selected item
dataTestIdstringProp to provide to unique data-testid

ErrorState

A component renders a warning Badge in the footer area.

NameTypeDescription
tooltipstringProp to provide the tooltip content

Props

NameTypeDefault
children
Defines the content to be displayed inside the component.
ReactNode
isOpen
Indicates whether the sidepanel is currently expanded.
boolean
onToggleButtonClick
A callback function triggered when the toggle button is clicked.
((isOpen: boolean) => void)
onClickLogo
A callback function that is invoked when the logo in header is clicked.
(() => void)
onClickHeaderAction
A callback function that executes when an action button in the header is clicked.
(() => void)
headerActionTooltip
Specifies the tooltip content for the header action button.
ReactNode
toggleButtonTooltip
Defines the content of the tooltip for the toggle button.
ReactNode
footer
The footer content of the component.
ReactNode
isLoading
Indicates if the component is in a loading state.
boolean
dataTestId
A custom identifier used for testing purposes
string
data-{foo}
Data attributes can be used by testing libraries to retrieve components or assert their existence
string
* - the prop is required.