---
name: ViewportGrid
menu: General
route: components/viewportGrid
---

import { Playground, Props } from 'docz';
import { DragAndDropProvider } from '../../contextProviders';
import { ViewportGrid } from '../../components';

# ViewportGrid

Used to display viewports in the viewer page.

## Import

```javascript
import { ViewportGrid } from '@ohif/ui';
```

## Basic usage

<Playground>
  <DragAndDropProvider>
  <div className="p-4 h-56">
    <ViewportGrid numRows={1} numCols={2}>
      <div className="flex items-center justify-center h-full text-white">
        Viewport1
      </div>
      <div className="flex items-center justify-center h-full text-white">
        Viewport2
      </div>
    </ViewportGrid>
  </div>
  </DragAndDropProvider>
</Playground>

## Properties

<Props of={ViewportGrid} />
