A minimal inline dropdown that blends into surrounding text for contextual selections without a full form field.
import {InlineSelect} from "@heroui-pro/react";
import {ListBox} from "@heroui/react";
<InlineSelect>
<InlineSelect.Trigger>
<InlineSelect.Value />
<InlineSelect.Indicator />
</InlineSelect.Trigger>
<InlineSelect.Popover>
<ListBox>
<ListBox.Item>{/* ... */}</ListBox.Item>
</ListBox>
</InlineSelect.Popover>
</InlineSelect>;HeroUI follows the BEM methodology to ensure component variants and states are reusable and easy to customize.
The Inline Select component uses these CSS classes:
.inline-select: Root wrapper with custom properties.inline-select__trigger: Ghost-styled trigger button (overrides HeroUI Select field styles).inline-select__value: Displayed text of the selected item(s).inline-select__indicator: Inline chevron icon (static positioning instead of absolute).inline-select__popover: Dropdown panel:hover or [data-hovered="true"] on .inline-select__trigger (text color change):focus-visible or [data-focus-visible="true"] on .inline-select__trigger (focus ring):disabled or [aria-disabled="true"] on .inline-select__trigger (reduced opacity)[data-open="true"] on .inline-select__indicator--inline-select-value-max-width: Max width of the value text (default: 12rem)--inline-select-indicator-size: Size of the indicator icon (default: 0.75rem)The root component. Wraps the HeroUI Select with ghost styling for inline use.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Trigger, Value, Indicator, Popover, and list items |
Also supports all HeroUI Select props.
Ghost-styled trigger button.
Also supports all HeroUI Select.Trigger props.
Displayed text of the selected item(s), truncated.
Also supports all HeroUI Select.Value props.
Chevron icon. Defaults to a ChevronsExpandVertical icon when no children are provided.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Custom indicator icon |
Also supports all HeroUI Select.Indicator props.
Dropdown panel for selection options.
| Prop | Type | Default | Description |
|---|---|---|---|
placement | Placement | 'bottom end' | Popover placement relative to the trigger |
Also supports all HeroUI Select.Popover props.
Resources