SortSelect
This topic describes the anatomy, API reference, and variations of the SortSelect primitive component.
Anatomy
import { SortSelect } from '@sitecore-search/ui';
const MySortSelectComponent = () => (
<SortSelect.Root>
<SortSelect.Trigger>
<SortSelect.SelectValue></SortSelect.SelectValue>
<SortSelect.Icon></SortSelect.Icon>
</SortSelect.Trigger>
<SortSelect.Content>
<SortSelect.Viewport>
<SortSelect.Option value={option1}>
<SortSelect.OptionText>{option1.label}</SortSelect.OptionText>
</SortSelect.Option>
<SortSelect.Option value={option2}>
<SortSelect.OptionText>{option3.label}</SortSelect.OptionText>
</SortSelect.Option>
</SortSelect.Viewport>
</SortSelect.Content>
</SortSelect.Root>
);Using the component
The following tabs describe use of the SortSelect primitive component.
Styled variants
API reference
SortSelect.Root
The SortSelect.Root component contains all the parts of the sort select.
|
Name |
Description |
|---|---|
|
|
The children inner to the |
|
|
Value of the select. |
|
|
Default value for the select. |
|
|
A callback that fires when the select value changes. |
|
|
Boolean. Default A flag to keep the select open |
|
|
Boolean. Default A flag to keep the select open |
|
|
A function that gets triggered when the open status changes. |
|
|
String. Default ltr. Orientation of the select. ltr or rtl. |
|
|
Name of the select. |
SortSelect.Trigger
The SortSelect.Trigger component is the button that triggers the select.
Parent: SortSelect.Root
Children: SortSelect.Icon and SortSelect.SelectValue
|
Name |
Description |
Default |
|---|---|---|
|
|
Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node. |
|
|
|
The children of the |
SortSelect.Icon
The AccordionFacets.Root component contains all the parts of an accordion.
|
Name |
Description |
Default |
|---|---|---|
|
|
Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node. |
|
|
|
The children of the |
SortSelect.SelectValue
The AccordionFacets.Root component contains all the parts of an accordion.
|
Name |
Description |
Default |
|---|---|---|
|
|
Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node. |
|
|
|
The children of the | |
|
|
The content that will be rendered inside the |
SortSelect.Content
The SortSelect.Content component pops out when the select is opened.
Parent: SortSelect.Root
Children: SortSelect.Viewport
|
Name |
Description |
Default |
|---|---|---|
|
|
Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node. |
|
|
|
The children of the | |
|
|
Event handler called when focus moves to the trigger after closing. It can be prevented by calling | |
|
|
Event handler called when the escape key is down. It can be prevented by calling | |
|
|
Event handler called when a pointer event occurs outside the bounds of the component. It can be prevented by calling |
SortSelect.Viewport
The scrolling SortSelect.Viewport component contains all of the items.
Parent: SortSelect.Content
Children: SortSelect.Option
|
Name |
Description |
Default |
|---|---|---|
|
|
Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node. |
|
|
|
The children of the |
SortSelect.OptionText
The SortSelect.OptionText component is textual part of the item. It should only contain the text you want to see in the trigger when that item is selected. It should not be styled to ensure correct positioning.
Parent: SortSelect.Option
|
Name |
Description |
Default |
|---|---|---|
|
|
Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node. |
|
