Movatterモバイル変換


[0]ホーム

URL:


Loading
  1. Elastic Docs/
  2. Reference/
  3. Search UI/
  4. API reference/
  5. React components

Sorting

Shows a dropdown for selecting the current Sort.

import { Sorting } from "@elastic/react-search-ui";...<Sorting  sortOptions={[    {      name: "Relevance",      value: "",      direction: ""    },    {      name: "Title",      value: "title",      direction: "asc"    }  ]}/>
NameDescription
className
labelA static label to show in the Sorting Component.
sortOptions
viewUsed to override the default view for this Component. SeeView customization below.
*Any other property passed will be passed through and available to use in a Custom View

A complete guide to view customization can be found in theCustomization: Component views and HTML section.

The following properties are available in the view:

NameDescription
classNamePassed through from main component.
labelThe label to display for this component. For example: "Sort by".
onChangefunction(value: string) - Pass the value to this callback from the selected sort option
options{ value: string; label: string;}[] - Options to display
valuestring - The currently selected value

SeeSorting.tsx for an example.


[8]ページ先頭

©2009-2026 Movatter.jp