EEnterUI
DocsComponentsThemesDonation
Get Started
      • DataTable
      • DataGrid
      • DataView
EnterUIDocsData AnalyticsTables and DataData ViewsDataView
Data AnalyticsUpdated 6 May 2026

DataView

Slot-based wrapper that pairs a toolbar, filters, and a content surface for table, grid, or list data pages.

DataView is the page-level shell for product data. It does not replace DataGrid or DataTable — instead it bundles title, description, actions, search, filters, sort, view-mode switch, and content states (loading, error, empty) so admin pages share one rhythm.

#Default usage

Idle state

DataView wraps a toolbar slot plus content; switch state to render the loading / error / empty slot.

API keys

Real DataTable / DataGrid / list goes here.

Code
<DataView title="API keys" search={<SearchInput placeholder="Search keys" />}>
  <p style={{ color: "var(--eui-foreground-muted)", margin: 0 }}>
    Real DataTable / DataGrid / list goes here.
  </p>
</DataView>

#Import

Code
import { DataView } from "@froggdesign/enter-ui-react";

#Patterns

Pass modes and a controlled mode to drive a switcher between table, grid, and list. Set hideViewSwitch to suppress the switcher when only one mode applies.

Code
<DataView
  modes={["table", "grid"]}
  mode={mode}
  onModeChange={setMode}
  toolbar={toolbar}
>
  {mode === "table" ? <DataTable {...} /> : <CardGrid {...} />}
</DataView>

#States

state toggles which slot is shown:

  • idle (default) renders children.
  • loading renders the loading slot.
  • error renders the error slot.
  • empty renders the empty slot.

#Accessibility

The view-mode switcher renders a labelled role="group" of toggle buttons with aria-pressed. The wrapper element defaults to <section>; pass as="div" when nesting inside a landmarked region.

#API

  • state, mode, defaultMode, onModeChange, modes, hideViewSwitch.
  • Header props: title, description, actions.
  • Slot props: search, sort, toolbar, filters, loading, error, empty, children.
  • modeSwitchLabel overrides the switcher's accessible label.

#Styling

Every exported component accepts className. EnterUI styles use .eui-* classes and --eui-* variables mapped from FroggDesign theme tokens.

PreviousDataGrid
NextBulkActionBar

On this page

  1. Default usage
  2. Import
  3. Patterns
  4. States
  5. Accessibility
  6. API
  7. Styling