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

SortMenu

Dropdown control for choosing a sort field and direction.

SortMenu standardizes list and table sorting controls while keeping the table implementation responsible for applying the actual sort.

#Default usage

Sort records

Choose a field and direction from one compact menu.

Code
<SortMenu
  fields={[
    { id: "createdAt", label: "Created" },
    { id: "name", label: "Name" },
    { id: "status", label: "Status" },
  ]}
  defaultValue={{ field: "createdAt", direction: "desc" }}
/>

#Import

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

#Controlled

Code
<SortMenu
  fields={fields}
  value={sort}
  onValueChange={setSort}
/>

#Patterns

Place SortMenu in a DataToolbar next to search, density, saved views, and column visibility controls.

#Accessibility

The field and direction groups use radio menu items, so selected state is announced by assistive technology. Clear sort returns undefined through onValueChange.

#API

  • fields: { id, label }[].
  • value: controlled { field, direction }.
  • defaultValue: initial sort value.
  • onValueChange: called with a sort value or undefined.
  • disabled: disables the trigger.

#Styling

SortMenu uses .eui-sort-menu classes and FroggDesign tokens for layout, state, focus, and disabled styling.

PreviousColumnVisibilityMenu
NextDensityToggle

On this page

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