Skip to content
Reeflow
Start Building

Container Component

The <reeflow-container> component provides a generic container that renders custom content within the standard Reeflow frame structure. It’s perfect for displaying custom UI elements, empty states, placeholders, or any other content that needs consistent Reeflow styling and theme support.

import { ReeflowProvider, ReeflowContainer } from '@reeflow/react';
<ReeflowProvider authToken="your-token">
<ReeflowContainer title="Custom Content">
<div style={{ textAlign: 'center', padding: '40px' }}>
<p>Your custom content goes here</p>
</div>
</ReeflowContainer>
</ReeflowProvider>;

Optional title displayed at the top of the container:

<reeflow-container title="Analytics Dashboard"></reeflow-container>

Override the theme inherited from the Provider:

<reeflow-container
title="Custom Content"
theme="ocean">
</reeflow-container>

Override the theme mode (light/dark/auto):

<reeflow-container
title="Custom Content"
theme-mode="dark">
</reeflow-container>

Display user-friendly messages when no data is available:

import { ReeflowContainer } from '@reeflow/react';
<ReeflowContainer title="No Data Available">
<div style={{ textAlign: 'center', padding: '60px 20px' }}>
<h3>No results found</h3>
<p>Try adjusting your filters or search criteria</p>
</div>
</ReeflowContainer>;

Combine containers with other Reeflow components for custom dashboard layouts:

import { ReeflowProvider, ReeflowContainer, ReeflowBarChart } from '@reeflow/react';
<ReeflowProvider authToken="your-token">
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '16px' }}>
<ReeflowBarChart title="Sales Data" query={salesQuery} />
<ReeflowContainer title="Quick Stats">
<div style={{ padding: '20px' }}>
<div>Total Revenue: $125,450</div>
<div>Orders: 1,234</div>
<div>Customers: 567</div>
</div>
</ReeflowContainer>
</div>
</ReeflowProvider>;

Create custom loading indicators:

import { ReeflowContainer } from '@reeflow/react';
<ReeflowContainer title="Loading Data">
<div style={{ display: 'flex', justifyContent: 'center', padding: '80px' }}>
<div className="spinner">Loading...</div>
</div>
</ReeflowContainer>;

Display forms, buttons, or other interactive elements:

import { ReeflowContainer } from '@reeflow/react';
<ReeflowContainer title="Export Data">
<div style={{ padding: '20px' }}>
<p>Download your data in various formats:</p>
<div style={{ display: 'flex', gap: '10px', marginTop: '16px' }}>
<button onClick={() => exportCSV()}>Export as CSV</button>
<button onClick={() => exportJSON()}>Export as JSON</button>
<button onClick={() => exportPDF()}>Export as PDF</button>
</div>
</div>
</ReeflowContainer>;

The Container component provides the standard two-layer padding structure (frame + container) with optional title, border, margin, and padding. It automatically inherits theming from the Provider and supports both light and dark modes.

You can apply custom styles using CSS Parts or inline styles:

/* Target the container element */
reeflow-container::part(container) {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 16px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
/* Target the title */
reeflow-container::part(title) {
color: #1a1a1a;
font-size: 24px;
font-weight: 700;
}

See the Theming documentation for more customization options.

The container component is fully typed when using TypeScript:

import type { ReeflowContainer } from '@reeflow/core';
const container = document.querySelector('reeflow-container') as ReeflowContainer;
// Typed properties
container.title = 'New Title';
container.theme = 'ocean';
container.themeMode = 'dark';

For complete type definitions, see the SDK Reference.