Intro
The panel is a responsive container for grouping and displaying information. It can be collapsed to save space on the screen.
Panel with nested components
Component availability
This component is available in the following libraries:
When to Use
Use the panel to:
- Group information.
- Give users the option of hiding this information.
- Show additional information on demand (for example, a panel could show optional input fields for an advanced search).
Don't use the panel to:
- Nest panels.
- Stack too many panels on one page.
- Use a non-collapsible panel when the content must remain visible at all times.
- Always include a title in the panel header that clearly conveys the panel’s purpose.
- To enable actions in the panel, use a panel with a custom toolbar.
- The panel provides a sticky header for cases where it should stay visible at all times.
- In fixed-height panels, avoid content that causes horizontal scrolling to prevent simultaneous vertical and horizontal scrolling.
Anatomy
- Header: Always visible, containing an optional icon, a title, and an optional toolbar.
- Icon or icon button (optional): To collapse or expand the content area.
- Title: Title text of the panel.
- Toolbar (optional): Contains a title, buttons, and other actions. It replaces the default title.
- Scrollbar (optional): Appears when content exceeds the visible area.
- Content area: Visible while the panel is expanded, containing components.
Panel anatomy
Types
Collapsible
A collapsible panel means that the user can expand and collapse it by clicking anywhere on the header or on the arrow button next to the header title. For example, clicking anywhere on the header of the collapsed panel (A) expands it to (B). In addition, the arrow icon indicates whether the content area is collapsed or expanded.
Panel – collapsible, expanded
Non-collapsible
The panel can be configured as non-collapsible. In this case, the header displays no icon and is not interactive. The content area is always expanded.
Panel – non-collapsible
Header toolbar
The default title of the header area can be replaced with a toolbar. This enables applications to place actions inside the header area. The header toolbar can be combined with either the collapsible or non-collapsible type.
When a toolbar is used, the header area of a collapsible panel is no longer interactive. Instead, the arrow icon button is used to collapse/expand the content area.
:badge, info, medium, _, SAPUI5 only:
Similar to the collapsible type, the header toolbar can be made clickable. In that case, both the header and the arrow icon button can be used to expand/collapse the content area.
Panel with header toolbar and actions
States
Component states
The panel supports the enabled component state only.
In the enabled state, users can interact with the panel and its controls. This applies to collapsible panels and panels that contain at least one interactive element.
Panel in the enabled state
For more information, see Component States.
Interaction states
By default, the panel supports only one interaction state – the regular state, which is responsible for expanding/collapsing.
Panel header in the regular interaction state
When a header toolbar is used, the arrow icon turns into an arrow icon button with three interaction states.
A. Regular state: Displayed by default.
B. Hover state: Displayed when the cursor moves over the arrow icon button.
C. Down state: Displayed while the arrow icon button is being pressed.
Panel with header toolbar interaction states
For more information, see Interaction States.
Focus states
The focus state indicates which element is currently focused and ready for use.
Unfocused state: Applies to all elements that are not focused.
Focus state: Indicated by an additional border around the panel header, arrow icon button, or the clickable header toolbar.
Unfocused
A panel in the unfocused state – collapsed (A) and expanded (B) states.
Panel, unfocused state
Focused header
The focus state is indicated by an additional border around the panel header – collapsed (A) and expanded (B) states.
Panel header, focused state
Focused icon button
The focus state is indicated by an additional border around the arrow icon button – collapsed (A) and expanded (B) states.
Panel with header toolbar, focused state
Focused header toolbar :badge, info, medium, _, SAPUI5 only:
The focus state is indicated by an additional border around the entire clickable header toolbar – collapsed (A) and expanded (B) states.
Panel header toolbar, focused state
For more information, see Focus States.
Behavior and Interaction
Mouse interaction
Expanding and collapsing a collapsible panel
Clicking the header area expands the panel. Releasing the click outside the header area does not trigger any action.
A. The panel is collapsed. Moving the cursor over the header area, the cursor is displayed as a pointer, indicating that the header area is clickable.
B. Clicking the header area applies the focus state to it.
C. Releasing the click over the header area expands the panel and rotates the arrow icon.
D. Releasing the click outside the header area keeps the panel collapsed.
Note: The same interactions apply to an expanded, collapsible panel.
Panel with collapsible header – expanding
Expanding and collapsing a panel with header toolbar
Clicking the arrow icon button expands or collapses the panel. Moving the cursor over the header toolbar does not change the cursor, as the toolbar itself is not clickable. If the click is released outside the arrow icon button, no action takes place.
A. The panel is collapsed. Moving the cursor over the arrow icon button applies the hover state.
B. Clicking the arrow icon button applies the down and focus states to it.
C. Releasing the click over the arrow icon button expands the panel and rotates the arrow icon.
D. Releasing the click outside the arrow icon button keeps the panel collapsed. The arrow icon button retains focus.
Note: The same interactions apply to an expanded, collapsible panel with header toolbar.
Panel with collapsible header toolbar – expanding
Expanding and collapsing a panel with clickable header toolbar :badge, info, large, _, SAPUI5 only:
Clicking the header toolbar expands the panel. Releasing the click over the header toolbar also applies the focus state to it. If the click is released outside the header toolbar, no action takes place.
A. The panel is collapsed. Moving the cursor over the header toolbar, the cursor is displayed as a pointer, indicating that the header toolbar is clickable.
B. Clicking the header toolbar.
C. Releasing the click over the header toolbar applies the focus state to the toolbar, expands the panel, and rotates the arrow icon.
D. Releasing the click outside the header toolbar keeps the panel collapsed.
Note: The same interactions apply to an expanded, collapsible panel with clickable header toolbar.
Expanding a collapsible panel with clickable header toolbar
Tooltip
When the cursor moves over the arrow icon or arrow icon button, a tooltip appears indicating whether the panel can be expanded or collapsed.
A. Tooltip on the arrow icon
B. Tooltip on the arrow icon button
Panel icon tooltip
Panel icon button tooltip
Gestures and mapping
Responsiveness
The panel height adapts to its content by default. When a fixed height is set and the content exceeds it, a vertical scrollbar appears automatically.
Panel with fixed height and vertical scrollbar
The panel width is set to 100% by default, but a fixed width can also be configured. The panel height adapts to its content based on the available width. When the content exceeds the available space within a fixed-size panel, the panel displays a vertical scrollbar.
Panel with fixed height and width scrollbar
For more information, see Content Density
Accessibility
SAP follows international standards, such as WCAG and WAI-ARIA, and strives to make our business solutions accessible and inclusive.
For more information, see Accessibility in SAP Fiori and the Accessibility Design Tools Handbook.
Keyboard navigation
The following keyboard combinations are supported by the SAPUI5 panel component.
If the focus is on the panel, moves focus to the next interactive UI group.
Screen reader support
For details on screen reader support and Accessible Rich Internet Applications (ARIA), see the UI5 Screen Reader Support and WAI-ARIA Authoring.
Content
Localization
The panel component supports both left-to-right (LTR) and right-to-left (RTL) reading directions.
Panel in left-to-right mode
Panel in right-to-left mode
Features
Sticky header
The panel header can be set as sticky, so it remains visible throughout the content area scroll.
Panel sticky header
Background design
By default, the content area background is translucent. The panel supports four background options: translucent (A), solid (A), transparent (B), and contrast (C). In Morning and Evening Horizon, the visual representation of the transparent and solid options is identical.
Panel – translucent/solid (A) and transparent backgrounds (B)
Panel – contrast background (C)
Framework Comparison
Some behaviors differ between frameworks due to implementation specifics. The table below summarizes the differences between SAPUI5 and SAP Web Components and lists the framework-specific patterns.
[internal_only] To request this feature for SAP Web Components, submit an InnerSource request.[/internal_only]
Related Links
[internal_only]
[/internal_only]
[external_only]
[external_only]