#Building your own UI
Unlike other classical DataGrid components out there, the Adaptable DataGrid gives you a lot more flexibility for building and customizing the user interface to suit your needs.
In your app, you need to render the <Adaptable.Provider /> with the data and the state, but this doesn't produce anything visible itself.
What you place inside it decides what users see. Most people will generally have the <Adaptable.Workspace /> which will render the full product - grid, dashboards and settings panel. However, all of the following components can be rendered inside the provider and will pick up the Adaptable state automatically:
Adaptable.Workspace— renders a resizable & collapsible panel with 2 sides:Adaptable.UIon one side thesettingsPanelon the other side.Adaptable.UI— the grid with its dashboard.Adaptable.UI.DataGrid— only the grid.- UI components —
Adaptable.UI.DataGrid,Adaptable.UI.Dashboard, the view picker, quick search, the column chooser, the settings panel and each of its pages, to lay out yourself.
<Adaptable.Workspace />The DataGrid with its four dashboards, plus the SettingsPanel, split by a resizable, collapsible divider.
<Adaptable.UI />The DataGrid with its four dashboards. The SettingsPanel opens in a dialog if not rendered elsewhere inside the <Adaptable.Provider />.
<Adaptable.UI.DataGrid />The DataGrid alone.
UI componentsIndividual pieces, placed wherever you like in your own layout.
#Adaptable Workspace
Adaptable.Workspace is the batteries-included option: it gives users the grid,
the dashboard and every settings page, without any layout work.
<Adaptable.Provider v-bind="props">
<Adaptable.Workspace />
</Adaptable.Provider>Read more on how you can customize the workspace.
The demo below shows the default configuration of the workspace.
The workspace can stack the settings panel beside the grid or above and below it, and show only the grid in the main pane. Try the options in the demo below.
#The grid and its dashboard
Adaptable.UI leaves out the settings panel. Whenever the settings panel is not rendered explicitly, it will open in
a dialog, from the dashboard's settings buttons or by calling
adaptableApi.settingsPanelApi.showSettingsPanel().
<Adaptable.Provider v-bind="props">
<Adaptable.UI />
</Adaptable.Provider>#Your own layout
The UI components can go anywhere inside the provider: an app header, a sidebar, a dialog. They all read and write the same state, so they stay in sync wherever they are placed — a view picked in your header is the view the grid shows, and the settings panel edits the same views.
<Adaptable.Provider v-bind="props">
<header>
<Adaptable.UI.ViewPicker />
<Adaptable.UI.QuickSearch />
</header>
<Adaptable.UI.DataGrid />
<Adaptable.UI.Overlays />
</Adaptable.Provider>The overlays (the settings dialog, notification toasts and cell note popovers)
are part of Adaptable.UI. When you compose the grid from
Adaptable.UI.DataGrid instead, render <Adaptable.UI.Overlays /> once
anywhere inside the provider, as above. The overlays open on top of the page,
so where you place it doesn't change the layout.
#Where popups are rendered
Column and context menus, selects, comboboxes, popovers, tooltips and dialogs
are rendered into an element appended to document.body, so they are never
cut off by the pane they open from. Column and context menus are kept within
the Adaptable.Workspace, or within the grid when there is no workspace.
To render them somewhere else - for example inside an element shown full screen -
pass portalContainer to the provider:
<script setup lang="ts">
import { useTemplateRef } from 'vue';
import { Adaptable, type AdaptableProps } from '@adaptabletools/datagrid-vue';
declare const props: AdaptableProps;
const popups = useTemplateRef<HTMLDivElement>('popups');
</script>
<template>
<Adaptable.Provider v-bind="props" :portalContainer="() => popups">
<Adaptable.Workspace />
</Adaptable.Provider>
<div ref="popups" />
</template>#Next steps
- Workspace — panel position, sizing, collapsing and a custom main pane
- UI components — every part, and the settings pages you can embed on their own
- Building blocks — buttons, selects and other controls for your own toolbars