React Splitter - items
The items array can contain:
- Objects with fields described in this section.
- Objects with any other fields. In this case, specify the itemTemplate.
As an alternative to items, you can use the dataSource property. It accepts the DataSource object, whose underlying stores supply an API that allows you to update individual items without reassigning the entire item collection.
collapsedSize
- import React from "react";
- import Splitter, { Item } from "devextreme-react/splitter";
- const App = () => (
- <React.Fragment>
- <Splitter ... >
- <Item ...
- collapsedSize="20px"
- />
- </Splitter>
- </React.Fragment>
- );
- export default App;
collapsible
To collapse a pane, you can also double-click the separator bar.
component
An alias for the template property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.
maxSize
- import React from "react";
- import Splitter, { Item } from "devextreme-react/splitter";
- const App = () => (
- <React.Fragment>
- <Splitter ... >
- <Item ...
- maxSize="500px"
- />
- </Splitter>
- </React.Fragment>
- );
- export default App;
minSize
- import React from "react";
- import Splitter, { Item } from "devextreme-react/splitter";
- const App = () => (
- <React.Fragment>
- <Splitter ... >
- <Item ...
- minSize="30%"
- />
- </Splitter>
- </React.Fragment>
- );
- export default App;
render
An alias for the template property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.
size
Specifies the initial size of an item (pane) in pixels or as a percentage. The size changes after any layout alteration.
- import React from "react";
- import Splitter, { Item } from "devextreme-react/splitter";
- const App = () => (
- <React.Fragment>
- <Splitter ... >
- <Item ...
- size="50%"
- />
- </Splitter>
- </React.Fragment>
- );
- export default App;
If you do not specify pane sizes, the UI component splits up the panes automatically with even distribution.
splitter
Specifies a splitter inside an item (pane).
Use this property to make the item a nested Splitter UI component.
- import React from "react";
- import Splitter, { Item } from "devextreme-react/splitter";
- const App = () => (
- <React.Fragment>
- <Splitter orientation="vertical">
- <Item text="Top Panel" />
- <Item>
- <Splitter>
- <Item text="Nested Left Panel" />
- <Item text="Nested Central Panel" />
- <Item text="Nested Right Panel" />
- </Splitter>
- </Item>
- </Splitter>
- </React.Fragment>
- );
- export default App;
template
The following types of the specified value are available.
- Assign a string containing the name of the required template.
- Assign a DOM Node of the template's container.
The following example adds a custom item to the component. In React, specify the render or component properties.
- import React from 'react';
- import Splitter, {
- Item
- } from 'devextreme-react/splitter';
- const renderCustomItem = () => {
- return <div>Custom Item</div>;
- }
- const App() = () => {
- return (
- <Splitter ... >
- <Item ...
- render={renderCustomItem}
- >
- </Item>
- </Splitter>
- );
- }
- export default App;
See Also
visible
When you set this property to true
at runtime, displayed pane size becomes 0. Update other pane sizes to display the pane.
If you have technical questions, please create a support ticket in the DevExpress Support Center.