React Box - Arrange and Align Items

Items can be arranged in a row or in a column depending on the value of the direction property.

App.js
  • import React from 'react';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Box from 'devextreme-react/box';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Box
  • height={200}
  • width={200}
  • direction="row"> {/* or "col" */}
  • {/* ... */}
  • </Box>
  • );
  • }
  • }
  •  
  • export default App;

If the Box items do not occupy the entire Box, you can align them along and crosswise the specified direction. For this purpose, use the align and crossAlign properties, respectively.

App.js
  • import React from 'react';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import Box from 'devextreme-react/box';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Box
  • height={200}
  • width={200}
  • align="center"
  • crossAlign="stretch">
  • {/* ... */}
  • </Box>
  • );
  • }
  • }
  •  
  • export default App;
See Also