|Kit

ComboboxList

A searchable, single-value option list with no trigger of its own — embed it inline inside a Popover, Drawer, or panel you already control.

ComboboxList is Select's data contract without the trigger: a search box and an option list that render permanently open, for embedding inside a container you already own the visibility of (a Popover, a Drawer, a custom panel) instead of owning its own floating dropdown. It's what powers DataTable's select column filter — click the filter icon once and you're already looking at a focused search box and list, no nested trigger to open.

'use client';
import { ComboboxList } from '@42/ui-react/combobox-list';

<ComboboxList data={['Paris', 'Lyon', 'Nice']} />

For a self-contained trigger + floating dropdown, use Select instead — same data / value / onChange contract, just with its own closed/open trigger button. For the multi-value equivalent see MultiComboboxList.

The playground below renders the list bare, on the page, so you can see it clearly — in real use it almost always sits inside something else that owns the open/close state:

'use client';
import { Popover } from '@42/ui-react/popover';
import { ComboboxList } from '@42/ui-react/combobox-list';

<Popover.Root>
  <Popover.Trigger>Filter</Popover.Trigger>
  <Popover.Content>
    <Popover.Body>
      <ComboboxList data={['Paris', 'Lyon', 'Nice']} />
    </Popover.Body>
  </Popover.Content>
</Popover.Root>

Playground

Component

SpinnerLoading preview

Props

Code

<Component placeholder="Search…" size="md" />

Data shapes

data accepts the same three shapes as Select — strings, { value, label?, disabled? } objects, or { group, items } groups:

Paris
Lyon
Nice
Le Havre
Berlin
Madrid
Lisbon
Helsinki

Clearable

clearable adds a clear button beside the search icon once there's a value.

Born2beroot
CPP Modules
Cub3D
Fract-ol
ft_printf
ft_transcendence
Get Next Line
Inception
Libft
Minishell

Custom rendering

renderItem works exactly like Select's — it receives the (value-narrowed) item, including any typed payload, and the live { selected, highlighted } state, and returns whatever the row should show.

boBorn2beroot360 XP
cpCPP Modules480 XP
cuCub3D690 XP
frFract-ol420 XP
ftft_printf240 XP
ftft_transcendence2100 XP
geGet Next Line240 XP
inInception945 XP
liLibft360 XP
miMinishell1080 XP

Label, description & error

Built in via Field, like the rest of the family — though most of the time you'll omit them here, since the container embedding this (a filter popover, a drawer) usually carries its own label.

Born2beroot
CPP Modules
Cub3D
Fract-ol
ft_printf
ft_transcendence
Get Next Line
Inception
Libft
Minishell
Pick your favourite

Controlled

onChange hands you the selected value, or null when cleared.

'use client';
import { useState } from 'react';
import { ComboboxList } from '@42/ui-react/combobox-list';

export function ProjectList() {
  const [value, setValue] = useState<string | null>(null);
  return (
    <ComboboxList
      data={['Libft', 'ft_printf', 'Get Next Line']}
      value={value}
      onChange={setValue}
      clearable
    />
  );
}

Forms

A name renders a hidden input carrying the picked value, so it wires into native <form> submission and FormData — the search input itself is never named (it would submit the typed query, not the value).

<form action={save}>
  <ComboboxList name="project" data={['Libft', 'ft_printf', 'Get Next Line']} />
</form>

API

Prop

Type

Accessibility

  • Same combobox keyboard model as Select/Autocomplete: type to filter, / to move, Enter to pick, Home / End to jump to first / last.
  • role="combobox" on the search input with aria-expanded="true" (it's permanently open), role="option" on each row, and the active-descendant wiring from Ark's Combobox machine.
  • There's no trigger and no floating panel — accessibility for the open/close affordance (focus return, Esc handling, aria-haspopup) is the embedding container's job (e.g. Popoveralready provides it).

On this page