Home/Components/ComboInput

ComboInput Component

A powerful combo box component combining text input with dropdown selection for flexible user input.

Live Preview

Current value: -

Current values: -

Usage

import { ComboInput } from '@featherstudio/react-daisyui-kit';
import { useState } from 'react';

export default function App() {
  const [singleValue, setSingleValue] = useState('');
  const [multiValue, setMultiValue] = useState<string[]>([]);

  const options = [
    { value: 'react', label: 'React' },
    { value: 'nextjs', label: 'Next.js' },
  ];

  return (
    <>
      <ComboInput
        value={singleValue}
        onChange={(value) => setSingleValue(value as string)}
        options={options}
      />

      <ComboInput
        value={multiValue}
        onChange={(value) => setMultiValue(value as string[])}
        options={options}
        multiple
      />
    </>
  );
}

Features

Text Input + Dropdown

Combined input and selection experience.

Searchable

Filter options while typing.

Flexible

Allow custom values or predefined options.

Accessible

Full keyboard navigation support.

Props

PropTypeDefaultDescription
valuestring | string[]-Current value (string for single, string[] for multiple)
onChange(value: string | string[]) => void-Called with the next value
options(string | { value: string; label?: string })[][]Dropdown options used for filtering and selection
multiplebooleanfalseEnable multi-select mode with tags
allowClearbooleantrueShow clear button when there is a value
maxDropdownHeightnumber200Maximum dropdown height in pixels
Back to Components