EEnterUI
DocsComponentsThemesDonation
Get Started
      • ColumnVisibilityMenu
      • SortMenu
      • DensityToggle
      • SavedViews
      • FilterBuilder
EnterUIDocsData AnalyticsTables and DataTable ControlsDensityToggle
Data AnalyticsUpdated 6 May 2026

DensityToggle

Segmented control for comfortable and compact data density.

DensityToggle gives tables and lists a shared control for row spacing without creating another custom toggle per surface.

#Default usage

Density control

Switch between comfortable and compact density.

Code
<DensityToggle defaultValue="comfortable" />

#Import

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

#Controlled

Code
<DensityToggle
  value={density}
  onValueChange={setDensity}
/>

#Patterns

Use this in table settings, resource lists, and admin queues where users switch between scannability and information density.

#Accessibility

DensityToggle reuses SegmentedControl, exposing radio group semantics and keyboard-operable buttons.

#API

  • value: controlled comfortable or compact.
  • defaultValue: initial density. Defaults to comfortable.
  • onValueChange: called with the next density.
  • disabled: disables both options.

#Styling

DensityToggle uses .eui-density-toggle classes and FroggDesign tokens for layout, state, focus, and disabled styling.

PreviousSortMenu
NextSavedViews

On this page

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