DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Box

The Box component allows you to create layouts of any complexity. You can arrange multiple blocks (items) horizontally or vertically, specify relative or absolute block sizes, and nest layouts within each other.

This demo may be temporarily unavailable due to an issue with the UNPKG service we use for resource loading. You can vote on it in the

UNPKG repository

We're working on a fix — sorry for the inconvenience.

Backend API

Set the Box's width and height properties to specify the layout's overall dimensions. To add blocks, use the items array, the dataSource property, or specify dxItems in the markup.

This demo shows how to use the Box component to create three different layouts.

The first Box sets direction to row and thus arranges items horizontally. Items use the ratio property to set their width in relative units.

The second Box shows two additional features:

  • Items now use the baseSize property to set their width in pixels or percent.
  • The middle item contains a nested Box. The align and crossAlign properties make sure that the nested layout is centered within its container.

The third Box demonstrates a layout similar to a basic web page structure. The root layout sets direction to col and arranges its items vertically. The nested layout is arranged horizontally.