Core Features

Advanced Features

React Data GridTheming API: Customising Borders & Scrollbars

Version 36.3.0

Control the borders around rows, cells and UI elements, and the appearance of scrollbars.

Borders are controlled using theme parameters ending Border. See the Borders section of the parameters reference for the core border parameters, or search "border" in the "All Parameters" section of the Theme Builder for a full list of border parameters.

The most important parameters relating to borders are:

  • borderColor and borderWidth - sets the default color and width for all borders, which can be overridden for individual borders using the parameters below
  • rowBorder and headerRowBorder - sets the horizontal borders between rows in the grid and header
  • columnBorder and headerColumnBorder - sets the vertical borders between columns in the grid and header
  • wrapperBorder - sets the border around the grid itself

Example: row borders Copy Link

const myTheme = themeQuartz.withParams({
    wrapperBorder: false,
    headerRowBorder: false,
    rowBorder: { style: 'dotted', width: 3, color: '#9696C8' },
    columnBorder: { style: 'dashed', color: '#9696C8' },
});

Borders between header cells Copy Link

Column borders between header cells have adjustable height, and there is also the option of styling the resize handle which is only present on resizable columns. See Customising Headers for more information.

Grand total row border Copy Link

The grandTotalRowBorder theme parameter sets the border between the grand total row and the data rows. See Enabling a Grand Total Row for an example.

Scrollbars Copy Link

By default the grid uses the browser's native scrollbars. These parameters change scrollbars throughout the grid, including those in tool panels and filters:

  • scrollbarThumbColor and scrollbarTrackColor - setting BOTH of these will change the colour of the draggable scroll thumb and of the track behind it. Setting only one will have no effect.
  • scrollbarWidth - set to 'thin' for narrow scrollbars or 'auto' for the browser default.
  • bodyScrollbarBorder - on browsers that always show scrollbars, this sets the border between the grid's main scrollbars and the cells.
const myTheme = themeQuartz.withParams({
    scrollbarThumbColor: '#9696C8',
    scrollbarTrackColor: 'transparent',
    scrollbarWidth: 'thin',
    bodyScrollbarBorder: { color: '#9696C8' },
});

This example also opens the Filters Tool Panel with a Set Filter, so you can see the scrollbar styles applied to other scrolling elements in the grid: