Skip to content

Theming

Customize the grid appearance using CSS variables.

The grid uses a dark theme by default, optimized for trading applications:

:root {
/* Backgrounds */
--grid-bg: #0a0a0f;
--grid-surface: #12121a;
--grid-border: #2a2a3a;
/* Text */
--grid-text: #e4e4e7;
--grid-muted: #71717a;
/* Accent */
--grid-accent: #3b82f6;
/* Flash colors */
--grid-flash-up: rgba(34, 197, 94, 0.4);
--grid-flash-down: rgba(239, 68, 68, 0.4);
/* Trading colors */
--grid-bid: #22c55e;
--grid-ask: #ef4444;
}

Override variables for a light theme:

.light-theme {
--grid-bg: #ffffff;
--grid-surface: #f4f4f5;
--grid-border: #e4e4e7;
--grid-text: #18181b;
--grid-muted: #71717a;
--grid-accent: #2563eb;
--grid-flash-up: rgba(34, 197, 94, 0.3);
--grid-flash-down: rgba(239, 68, 68, 0.3);
--grid-bid: #16a34a;
--grid-ask: #dc2626;
}

Apply the class to the grid container:

<div className="light-theme">
<DataGrid data={data} columns={columns} rowKey="id" />
</div>

Match your application’s brand:

.brand-theme {
--grid-accent: #8b5cf6; /* Purple accent */
--grid-bid: #10b981; /* Teal for positive */
--grid-ask: #f43f5e; /* Rose for negative */
}

Apply different themes to different grids:

<div className="dark-theme">
<DataGrid data={positions} columns={positionColumns} rowKey="id" />
</div>
<div className="light-theme">
<DataGrid data={orders} columns={orderColumns} rowKey="id" />
</div>
VariableDefaultDescription
--grid-bg#0a0a0fMain background
--grid-surface#12121aSurface/card background
--grid-border#2a2a3aBorder color
VariableDefaultDescription
--grid-text#e4e4e7Primary text
--grid-muted#71717aSecondary/muted text
VariableDefaultDescription
--grid-accent#3b82f6Accent/highlight color
--grid-hoverrgba(255,255,255,0.05)Row hover background
VariableDefaultDescription
--grid-bid#22c55eBid/buy/positive color
--grid-ask#ef4444Ask/sell/negative color
--grid-flash-uprgba(34, 197, 94, 0.4)Flash up background
--grid-flash-downrgba(239, 68, 68, 0.4)Flash down background
.askturret-grid-row {
height: 40px; /* Default: 36px */
}
.askturret-grid.compact .askturret-grid-row {
height: 28px; /* Compact mode */
}
.askturret-grid-row:nth-child(even) {
background: var(--grid-surface);
}
.askturret-grid-row:hover {
background: var(--grid-hover);
}
.askturret-grid-header {
background: var(--grid-surface);
border-bottom: 1px solid var(--grid-border);
}
.askturret-grid-header-cell {
font-weight: 600;
text-transform: uppercase;
font-size: 0.75rem;
letter-spacing: 0.05em;
}
/* All cells */
.askturret-grid-cell {
padding: 0 12px;
}
/* Numeric cells */
.askturret-grid-cell[data-align="right"] {
font-variant-numeric: tabular-nums;
}
.askturret-grid-filter {
background: var(--grid-surface);
border: 1px solid var(--grid-border);
color: var(--grid-text);
}
.askturret-grid-filter:focus {
border-color: var(--grid-accent);
outline: none;
}

Each component inherits from the same CSS variables:

.askturret-orderbook-bid {
color: var(--grid-bid);
}
.askturret-orderbook-ask {
color: var(--grid-ask);
}
.askturret-orderbook-depth-bar-bid {
background: var(--grid-bid);
opacity: 0.2;
}
.askturret-timesales-buy {
color: var(--grid-bid);
}
.askturret-timesales-sell {
color: var(--grid-ask);
}

Respect user’s system theme preference:

@media (prefers-color-scheme: light) {
:root {
--grid-bg: #ffffff;
--grid-surface: #f4f4f5;
--grid-border: #e4e4e7;
--grid-text: #18181b;
/* ... other light theme variables */
}
}

Or use JavaScript:

const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
<div className={prefersDark ? 'dark-theme' : 'light-theme'}>
<DataGrid ... />
</div>
.bloomberg-theme {
--grid-bg: #000000;
--grid-surface: #1a1a1a;
--grid-border: #333333;
--grid-text: #ff9900;
--grid-muted: #666666;
--grid-accent: #ff9900;
--grid-bid: #00ff00;
--grid-ask: #ff0000;
font-family: 'Consolas', 'Monaco', monospace;
}