Adaptable

#Building Blocks

The components export holds buttons, selects, checkboxes and other controls with the Adaptable look, for toolbars and panels that sit next to the grid. They need an <Adaptable.Provider /> ancestor.

For the parts of the grid itself (the dashboard, the view picker, the settings panel and its pages), see UI.

Importing the building blocks
import { components } from '@adaptabletools/datagrid-react';

const { Select, Button } = components;

components contains:

  • Button — variant ('text' | 'outlined' | 'contained'), tone, size ('small' | 'medium' | 'large'), icon, tooltip, onClick, …
  • Select — a dropdown; see below.
  • CheckBox
  • Icon
  • Logo
  • Layout — a flex container.
  • Tabs
  • GridFilterInput — the grid filter editor of the current view, as shown in the dashboard.

The SelectProps and ButtonProps types are exported too.

#Using the Select component

Select needs three props:

  • options — { label, value, disabled? }[]. Options can also be grouped ({ label, options }) or separated with 'separator'.
  • value — the selected value.
  • onChange(value) — called when the user picks an option.

Optional props include size ('small' | 'medium'), placeholder, disabled, label, className and style.

#
A view switcher built with Select and Button

Select lists the views and Button moves to the next one. Both read and write the current view through the useViews hook, so they stay in sync with the Adaptable state.

open
loading demo…