Form

Combobox

Combines search, filtering, and selection in one input pattern.

Imports

Use the same component slug for React, Vue, and style token lookup. Do not import components from package roots.

import { Combobox, ComboboxInput, ComboboxList, ComboboxItem, ComboboxTrigger } from "@line/abc-def-react/combobox";
<script setup lang="ts">
import { Combobox, ComboboxInput, ComboboxList, ComboboxItem, ComboboxTrigger } from "@line/abc-def-vue/combobox";
</script>

Shadcn references

Compare the corresponding shadcn React and Vue documentation for the same component slug.

Basic usage

React
Vue
CSS
import {
  Combobox,
  ComboboxInput,
  ComboboxItem,
  ComboboxList,
} from "@line/abc-def-react/combobox";

export function Example() {
  return (
    <Combobox items={["React", "Vue", "CSS"]}>
      <ComboboxInput placeholder="Framework" />
      <ComboboxList>
        <ComboboxItem value="React">React</ComboboxItem>
        <ComboboxItem value="Vue">Vue</ComboboxItem>
        <ComboboxItem value="CSS">CSS</ComboboxItem>
      </ComboboxList>
    </Combobox>
  );
}
<script setup lang="ts">
import {
  Combobox,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxItem,
  ComboboxList,
  ComboboxViewport,
} from "@line/abc-def-vue/combobox";

const frameworks = ["React", "Vue", "CSS"];
</script>

<template>
  <Combobox :items="frameworks">
    <ComboboxInput placeholder="Framework" />
    <ComboboxList>
      <ComboboxViewport>
        <ComboboxEmpty>No framework found.</ComboboxEmpty>
        <ComboboxItem
          v-for="framework in frameworks"
          :key="framework"
          :value="framework"
        >
          {{ framework }}
        </ComboboxItem>
      </ComboboxViewport>
    </ComboboxList>
  </Combobox>
</template>

Component tokens

Component TokenSemantic TokenDefault Primitive Token
--combobox-trigger-icon-fg--muted-foreground--color-zinc-500
--combobox-content-bg--popover--color-white
--combobox-content-fg--popover-foreground--color-zinc-950
--combobox-content-border--border-input--color-zinc-200
--combobox-content-ring--foreground--color-zinc-950
--combobox-content-input-group-border--border-input--color-zinc-200
--combobox-content-input-group-bg--border-input--color-zinc-200
--combobox-item-bg-highlighted--accent--color-zinc-100
--combobox-item-fg-highlighted--accent-foreground--color-zinc-900
--combobox-label-fg--muted-foreground--color-zinc-500
--combobox-empty-fg--muted-foreground--color-zinc-500
--combobox-separator-bg--border--color-zinc-200
--combobox-chips-border--border-input--color-zinc-200
--combobox-chips-ring--ring--color-zinc-400
--combobox-chips-border-destructive--destructive--color-red-50
--combobox-chips-bgLiteral valuetransparent
--combobox-chip-bg--muted--color-zinc-100
--combobox-chip-fg--foreground--color-zinc-950
--combobox-chips-ring-destructive--destructive--color-red-50

Composition exports

ComboboxComboboxInputComboboxListComboboxItemComboboxTrigger

Usage notes

  • Use when the option list is long.
  • Prefer select for short static option sets.
  • Related component tokens use the `combobox` token group in `@line/abc-def-styles/css`.