EnterUI
DocsComponentsThemesExamplesDonation
Get Started
      • ColumnVisibilityMenu
      • SortMenu
      • DensityToggle
      • SavedViews
      • FilterBuilder

Default usage

  1. EnterUI
  2. /Docs
  3. /Data and Analytics
  4. /Tables and Data
  5. /Table Controls
  6. /DensityToggle
Updated 3 October 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
  • Default usage
  • Import
  • Controlled
  • Patterns
  • Accessibility
  • API
  • Styling