Panel
Panel components provide a surface for contextual information alongside the main content area.Beta
New and ready to use. We'll provide comms and support for any major changes.
Installation
| Install | yarn add @atlassian/panel-system |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlassian/panel-system, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
PanelContainer props
| Description | The content of the panel container. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | When Useful for panels that require the user to complete an action before continuing. |
|---|---|
| Default | false |
| Type | boolean |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
PanelHeader props
| Description | The content of the panel header. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
PanelTitle props
| Description | The title text content. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | Optional icon to display alongside the title. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
PanelSubheader props
| Description | An optional cover image to display above the subheader title.
Accepts any React node — typically an The image fills the full width of the panel and is cropped to a fixed height of 160px. Accessibility: any |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | An optional inline edit control to render in place of the static title, allowing the title to
be edited in place. Typically a When provided, this is rendered instead of the |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | Optional content shown after the regular subheader scrolls out of view. Accepts any React node. Content is vertically centered in a 2rem-high slot, with 8px bottom padding, no top padding, and 24px inline padding around the slot. Consumers are responsible for content sizing and text truncation. Sticky state, refs, and observation are only mounted when this content is provided.
|
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
| Description | The title text to display in the subheader. |
|---|---|
| Type | string |
| Description | An optional icon to display at the start of the title.
Accepts any React node — typically an |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
SubheaderInlineEdit props
SubheaderInlineEdit accepts the same props as
Inline Editable Textfield,
except for isCompact, which is set internally so the component matches the PanelSubheader
layout.
PanelBody props
| Description | The content of the panel body. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | Controls the padding of the panel body. |
|---|---|
| Default | "default" |
| Type | "none" | "default" |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
PanelAction props
| Description | Appearance style for buttons. |
|---|---|
| Type | "default" | "subtle" | "primary" | "discovery" |
| Description | Indicates whether the popup triggered by the action is currently expanded. Use this when the action opens a popup and the open state is controlled by the consuming experience. Omit when the action does not open a popup. |
|---|---|
| Type | boolean | "true" | "false" |
| Description | Identifies the type of popup triggered by the action. Use |
|---|---|
| Type | boolean | "dialog" | "menu" | "listbox" | "tree" | "grid" | "true" | "false" |
| Description | Aria-label for accessibility. |
|---|---|
| Type | string |
| Description | The content of the action button. |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | URL for link actions. |
|---|---|
| Type | string |
| Description | Icon component for icon-only buttons. |
|---|---|
| Type | ComponentClass<any, any> | FunctionComponent<any> |
| Description | Label for icon buttons (used for accessibility). |
|---|---|
| Type | string |
| Description | Click handler for button and link actions. The handler receives both the event and an optional analytics event for tracking user interactions. |
|---|---|
| Type | ((event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) | ((event: MouseEvent<...>, analyticsEvent?: UIAnalyticsEvent) => void) |
| Description | Allows getting a ref to the component instance.
Once the component unmounts, React will set @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|---|---|
| Type | string | Ref<HTMLAnchorElement | HTMLButtonElement> |
| Description | Rel attribute for links (e.g., "noopener noreferrer"). |
|---|---|
| Type | string |
| Description | Spacing style for icon buttons. |
|---|---|
| Type | "default" | "compact" |
| Description | Target attribute for links (e.g., "_blank"). |
|---|---|
| Type | string |
| Description | Unique string that appears as a data attribute |
|---|---|
| Type | string |
PanelActionGroup props
| Description | The action components to group together. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
PanelActionExpand props
| Description | Label for icon buttons (used for accessibility). |
|---|---|
| Type | string |
| Description | Click handler for button and link actions. The handler receives both the event and an optional analytics event for tracking user interactions. |
|---|---|
| Type | ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) | ((event: React.MouseEvent<HTMLAnchorElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) |
| Description | Unique string that appears as a data attribute |
|---|---|
| Type | string |
PanelActionNewTab props
| Description | URL to open in the new tab. |
|---|---|
| Type | string |
| Description | Label for icon buttons (used for accessibility). |
|---|---|
| Type | string |
| Description | Click handler for button and link actions. The handler receives both the event and an optional analytics event for tracking user interactions. |
|---|---|
| Type | ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) | ((event: React.MouseEvent<HTMLAnchorElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) |
| Description | Unique string that appears as a data attribute |
|---|---|
| Type | string |
PanelActionMore props
| Description | Label for icon buttons (used for accessibility). |
|---|---|
| Type | string |
| Description | Click handler for button and link actions. The handler receives both the event and an optional analytics event for tracking user interactions. |
|---|---|
| Type | ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) | ((event: React.MouseEvent<HTMLAnchorElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) |
| Description | Unique string that appears as a data attribute |
|---|---|
| Type | string |
PanelActionClose props
| Description | Label for icon buttons (used for accessibility). |
|---|---|
| Type | string |
| Description | Optional callback that runs before closing the panel. Return false or Promise<false> to prevent the panel from closing. Useful for showing discard confirmation modals when there are unsaved changes. @example |
|---|---|
| Type | () => boolean | Promise<boolean> |
| Description | Click handler for closing the panel. Typically, this should trigger the panel close logic. For automatic panel closing via context, use PanelActionCloseSmart instead. Can be omitted when close behavior is handled externally (e.g., via ref-based modal triggers or other interceptors). The event parameter provides access to the click event, and the optional analyticsEvent parameter enables analytics tracking. |
|---|---|
| Default | undefined |
| Type | (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void |
| Description | Allows getting a ref to the component instance.
Once the component unmounts, React will set @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|---|---|
| Type | string | Ref<HTMLButtonElement> |
| Description | Unique string that appears as a data attribute |
|---|---|
| Type | string |
PanelActionCloseSmart props
| Description | Label for icon buttons (used for accessibility). |
|---|---|
| Type | string |
| Description | Optional click handler for additional side effects (e.g., analytics). If provided, it will be called before closing the panel via context. |
|---|---|
| Type | () => void |
| Description | Unique string that appears as a data attribute |
|---|---|
| Type | string |
PanelActionBack props
| Description | Label for icon buttons (used for accessibility). |
|---|---|
| Type | string |
| Description | Click handler for button and link actions. The handler receives both the event and an optional analytics event for tracking user interactions. |
|---|---|
| Type | ((event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void) | ((event: MouseEvent<...>, analyticsEvent?: UIAnalyticsEvent) => void) |
| Description | Allows getting a ref to the component instance.
Once the component unmounts, React will set @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|---|---|
| Type | string | Ref<HTMLButtonElement> |
| Description | Unique string that appears as a data attribute |
|---|---|
| Type | string |
PanelProvider props
| Description | Child components that will have access to the panel manager |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | Optional initial state for the panel system.
|
|---|---|
| Type | { activePanel?: AllPanels<Record<string, any>>; preloadedPanels?: PreloadedPanel[]; panelWidth?: number; } |
Trigger props
| Description | No description. |
|---|---|
| Type | ({ ref }: { ref: React.RefObject<HTMLElement>; }) => React.ReactNode |
| Description | No description. |
|---|---|
| Type | { [x: string]: any; } |
| Description | No description. |
|---|---|
| Type | ((instance: HTMLElement) => void) | React.RefObject<HTMLElement> |
| Description | Optional instance ID for this panel. If not provided, a unique ID will be automatically generated. Best Practice: Let Trigger generate the ID automatically unless you need to reference the panel elsewhere (e.g., for programmatic closing). This keeps ID generation co-located with the trigger rather than managed at the manager level. @example |
|---|---|
| Type | string |
| Description | Callback fired when the panel is closed. Useful for analytics tracking. |
|---|---|
| Type | () => void |
| Description | Callback fired when the panel is opened. Useful for analytics tracking. |
|---|---|
| Type | () => void |
| Description | No description. |
|---|---|
| Type | InternalEntryPointRepresentation<any, any, any, any, any>TEntryPoint |
| Description | No description. |
|---|---|
| Type | { [x: string]: any; } |
| Description | Load entry point on focus (for keyboard navigation). |
|---|---|
| Default | false |
| Type | boolean |
| Description | Whether to open the panel on click. Set this to |
|---|---|
| Default | true |
| Type | boolean |
| Description | Preload entry point on focus (for keyboard navigation). |
|---|---|
| Default | false |
| Type | boolean |
PanelsRenderer props
| Description | Component to render for the active panel. The panel instance is automatically wrapped in PanelContext.Provider, so you can use useCurrentPanel() within your component to access panel data. @example |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
PanelRouter props
| Description | Error fallback function to render when entry point loading fails. Defaults to a simple "Error loading panel" text. |
|---|---|
| Default | () => <Text as="p">Error loading panel</Text> |
| Type | (props: { error: Error; onClose: () => void; }) => React.ReactElement<any, any> |
| Description | Fallback UI to show while the entry point is loading. Defaults to a skeleton state that indicates header and body content. Can be customised and composed with different skeleton components. |
|---|---|
| Default | <PanelSkeleton /> |
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | Optional wrapper component to wrap the rendered entry point. Useful for adding styling, resizing functionality, or other wrapper behavior. @example |
|---|---|
| Type | (props: { children: React.ReactNode; }) => React.ReactNode |
Hooks
The package exports a set of hooks for managing panel state. These must be used within a
PanelProvider. As hooks do not have a props interface, their signatures and return types are
described below.
usePanelManager
Returns both the panel state and the manager actions. Must be called within a PanelProvider.
If you only need to trigger actions, prefer usePanelActions to avoid re-rendering when panel state
changes.
const { state, manager } = usePanelManager();
The returned state is of type PanelSystemState:
| Description | The active panel, or null when the slot is closed. |
|---|---|
| Type | EntryPointPanel<Record<string, any>> | Panel<Record<string, any>> |
| Description | Explicit requested/resized width in pixels, retained for the provider's lifetime. Undefined means no saved preference: navigation supplies responsive defaults. This is not the rendered width; available space may constrain it without changing the preference. |
|---|---|
| Type | number |
| Description | No description. |
|---|---|
| Type | PreloadedPanel[] |
usePanelActions
Returns only the panel manager actions (for example openPanel, closePanel, setPanelWidth).
Components using this hook do not re-render when panels open, close, or resize.
const manager = usePanelActions();
usePanelState
Returns only the panel state (of type PanelSystemState). Use this when you only need to read
panel state.
const state = usePanelState();
useCurrentPanel
Returns the panel currently being rendered. Must be used within a PanelsRenderer render function
that wraps panels in PanelContext.Provider. Accepts an optional generic for the panel's params.
const panel = useCurrentPanel<{ title: string }>();
useCloseCurrentPanel
Returns a function that closes the current panel. Must be used within a PanelsRenderer that
provides PanelContext.
const closePanel = useCloseCurrentPanel();
usePanel
Convenience hook that returns both the current panel and a closePanel function, reducing
boilerplate when you need both.
const { panel, closePanel } = usePanel();
Context
PanelContext
A React context that provides the current panel being rendered. PanelsRenderer wraps each panel in
a PanelContext.Provider. Prefer the useCurrentPanel, useCloseCurrentPanel, and usePanel
hooks over consuming this context directly.
const panel = useContext(PanelContext);