Panel
Use Panels to structure a screen. Panels may contain Tiles, may be scrollable, and optionally searchable.
tip
To learn more about how to use Panels refer to the Panel pattern documentation.
Example
Usage Rules
Do:
- Use Panels to establish the basic layout structure of any Adjust application
- Use the default Panel variant most of the time
- Use the contrast variant exclusively to create areas where you want to place Tiles.
Don’t:
- Nest panel deeper than one level
- Use search input without title
Variants
Appearance
Panels come with two different background color variations: default
and contrast
.
Use the contrast variant exclusively to create areas where you want to place Tiles.
Custom Borders
You can decide whether a border should be rendered on every side in the Panel.
Use borders
props for this. It should be an array with 4 items where every items defines a border for an appropriate side: first value - top side, second - right side, third - bottom side, fourth - left side.
Searchable
Panels can be searchable. The search query may life-update the Panel’s content.
Use onSearch
callback for this.
Title
Examples
Tiles
Use the contrast variant exclusively to create areas where you want to place Tiles.
Scrollable
Use the css prop and set height to make the Panel scrollable. When there is a scroll you'll have a shadow on top and bottom depending on scroll position.
Page Layout with the Panels
The following example demonstrates the usage of borders
prop to correctly set up borders when you layout your application with Panels.
Props
Name | Type | Default |
---|---|---|
title The title of the Panel |
| — |
onSearch This callback fires when a user types into the search input. Provide this prop to make the Panel searchable. |
| — |
placeholderSearchInput Placeholder for the search input. Native HTML attribute: Link |
| "Search" |
padding "default" will create a default paddding in the body of the panel. |
| "default" |
appearance Use 'contrast' appearance when placing a Tile inside the Panel |
| "default" |
borders This array should contain 4 values, where every value will render a border for the appropriate side. The order: top, right, bottom, left |
| "[true, true, true, true]" |
children The content of the panel |
| — |
css Add custom styles to this component. Use with caution. Learn more here: Link |
| — |
inputFieldCss |
| — |
data-{foo} Data attributes can be used by testing libraries to retrieve components or assert their existence |
| — |
* - the prop is required. |