Pane
Panes give users a quick way to resize layouts vertically or horizontally by interacting with the splitter. They can also be used to create expandable or collapsible layouts.
- To make a structured layout resizable, expandable, or collapsible
How to use it
Vertical
Panes can be used in a vertical orientation. The panes resize up to the values that you set.
Horizontal
Panes can be used in a horizontal orientation as well.
Grid
Panes can be resized in both vertical and horizontal directions for a complex grid flexible layout.
Customization
Panes can be collapsed or expanded by using the SplitterButton.
Vertical collapse
Horizontal collapse
Splitter button position
The SplitterButton can be positioned at the start, center or end of the splitter. Its default position is at the start when used in vertical orientation and at the center when used in horizontal orientation.
Configuration
- Name9.1.0•View source•View on npm
- Installnpm install @zendeskgarden/react-grid
- Depsnpm install react react-dom styled-components @zendeskgarden/react-theming
- Importimport { Pane, PaneProvider } from '@zendeskgarden/react-grid'
API
PaneProvider
Prop name | Type | Default | Description |
---|---|---|---|
children | Surfaces render props for applying splitter state to the supporting layout Parameters id Provides the getColumnValue Gets column value by key getRowValue Gets row value by key getGridTemplateRows Gets grid template rows track getGridTemplateColumns Gets grid template columns track | ||
columnValues | Record<string, number> | Defines column values, in | |
defaultColumnValues | Record<string, number> | Defines default column values, in | |
defaultRowValues | Record<string, number> | Defines default row values, in | |
id | string | Identifies the pane provider | |
onChange | Handles splitter position changes Parameters rowValues The updated row values columnValues The updated column values | ||
rowValues | Record<string, number> | Defines row values, in | |
totalPanesHeight | number | Required | Provides the total height, in |
totalPanesWidth | number | Required | Provides the total width, in |
Pane
Extends HTMLAttributes<HTMLDivElement>
Pane.Content
Extends HTMLAttributes<HTMLDivElement>
Pane.Splitter
Extends HTMLAttributes<HTMLDivElement>
Prop name | Type | Default | Description |
---|---|---|---|
isFixed | boolean | Determines if the splitter only toggles between | |
layoutKey | string | Required | Specifies the splitter key |
max | number | Required | Sets a maximum, in |
min | number | Required | Sets a minimum, in |
orientation | 'end' | 'start' | 'top' | 'bottom' | 'end' | Determines splitter orientation within a pane |
providerId | string | Identifies the associated |
Pane.SplitterButton
Extends ButtonHTMLAttributes<HTMLButtonElement>
Prop name | Type | Default | Description |
---|---|---|---|
label | string | Required | Renders the provided label text inside a tooltip |
placement | 'end' | 'start' | 'center' | Adjusts the placement of the splitter button. Assumes start when vertical and center when horizontal, by default. |