ion-split-pane
A split pane is useful when creating multi-view layouts. It allows UI elements, like menus, to be displayed as the viewport width increases.
If the device's screen width is below a certain size, the split pane will collapse and the menu will be hidden. This is ideal for creating an app that will be served in a browser and deployed through the app store to phones and tablets.
#
Setting BreakpointsBy default, the split pane will expand when the screen is larger than 992px. To customize this, pass a breakpoint in the when
property. The when
property can accept a boolean value, any valid media query, or one of Ionic's predefined sizes.
Size | Value | Description |
---|---|---|
xs | (min-width: 0px) | Show the split-pane when the min-width is 0px (meaning, always) |
sm | (min-width: 576px) | Show the split-pane when the min-width is 576px |
md | (min-width: 768px) | Show the split-pane when the min-width is 768px |
lg | (min-width: 992px) | Show the split-pane when the min-width is 992px (default break point) |
xl | (min-width: 1200px) | Show the split-pane when the min-width is 1200px |
#
Usage- ANGULAR
- JAVASCRIPT
- REACT
- STENCIL
- VUE
#
Properties#
contentIdDescription | The id of the main content. When usinga router this is typically ion-router-outlet .When not using a router, this is typically your main view's ion-content . This is not theid of the ion-content inside of your ion-menu . |
Attribute | content-id |
Type | string \| undefined |
Default | undefined |
#
disabledDescription | If true , the split pane will be hidden. |
Attribute | disabled |
Type | boolean |
Default | false |
#
whenDescription | When the split-pane should be shown. Can be a CSS media query expression, or a shortcut expression. Can also be a boolean expression. |
Attribute | when |
Type | boolean \| string |
Default | QUERY['lg'] |
#
EventsName | Description |
---|---|
ionSplitPaneVisible | Expression to be called when the split-pane visibility has changed |
#
CSS Custom PropertiesName | Description |
---|---|
--border | Border between panes |
--side-max-width | Maximum width of the side pane. Does not apply when split pane is collapsed. |
--side-min-width | Minimum width of the side pane. Does not apply when split pane is collapsed. |
--side-width | Width of the side pane. Does not apply when split pane is collapsed. |