# Organize a dashboard with sections

## 1. Add a section

![Add section on the Sales dashboard: a new, empty Metrics section under its reports](https://quill.co/bi-tool/sections-add.webp "quill.co/dashboards")

## 2. Create Sections For "Charts" and "Tables"

![The Sales dashboard's three empty sections: Metrics, Charts and Tables](https://quill.co/bi-tool/sections-empty.webp "quill.co/dashboards")

## 3. Drag reports into sections

![Total revenue dragged by its handle into Metrics, with Charts still empty](https://quill.co/bi-tool/sections-move.webp "quill.co/dashboards")

## 4. Rearrange reports

![The Sales dashboard rearranged: Total revenue, Orders, Average order and Largest order in Metrics, then Revenue and Revenue by category in Charts](https://quill.co/bi-tool/sections-done.webp "quill.co/dashboards")

## 5. Build

```tsx
import { Chart, useDashboard } from "@quillsql/react";

// One grid per section: how many reports share a row, and how tall each is.
const grids: Record<string, { columns: number; height: number }> = {
  Metrics: { columns: 4, height: 48 },
  Charts: { columns: 2, height: 300 },
  Tables: { columns: 1, height: 360 },
};

export function Sales() {
  const { sections, sectionOrder } = useDashboard("Sales");
  if (!sections) return <p>Loading…</p>;

  return sectionOrder.map(({ section }) => {
    const reports = sections[section] ?? [];
    if (reports.length === 0) return null;
    const { columns, height } = grids[section] ?? { columns: 2, height: 300 };

    return (
      <section key={section}>
        <h2>{section}</h2>
        <div style={{ display: "grid", gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, gap: 16 }}>
          {reports.map((report) => (
            <div key={report.id} className="card">
              <h3>{report.name}</h3>
              <Chart reportId={report.id} containerStyle={{ width: "100%", height }} />
            </div>
          ))}
        </div>
      </section>
    );
  });
}
```

![Your app's Sales page: the four metrics on one row, the two charts on the next, and the Recent orders table across the page](https://quill.co/bi-tool/sections-grids.webp "yourapp.com/sales")
