mcpField
S
syncfusion-react-dropdownlist

syncfusion-react-dropdownlist

github.com/syncfusionDesign & UI352 installsUpdated 6d ago
Repository

About syncfusion-react-dropdownlist

A reference skill for building Syncfusion’s React DropDownList component. It guides React developers through data binding, filtering, customization, and accessibility, from setup to advanced patterns.

Key features

  1. 01Local and remote data binding
  2. 02Search filtering and custom filter logic
  3. 03Grouped lists and item templates
  4. 04Virtual scrolling for large lists
  5. 05Accessibility, localization, and RTL support

Use cases

  1. 01Create a searchable list of selectable values
  2. 02Display categorized options with custom layouts
  3. 03Load options from a remote data source
  4. 04Handle large option sets with virtual scrolling

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/react-ui-components-skills --skill syncfusion-react-dropdownlist

After installing, type/syncfusion-react-dropdownlistin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
accessibility-styling-localization.md
api.md
data-binding.md
features-and-configuration.md
filtering.md
getting-started.md
grouping-and-templates.md
how-to.md

Details

From the project README

Syncfusion React DropDownList

The DropDownList component provides a list of predefined values from which users can select a single value. It supports local and remote data binding, filtering, grouping, custom templates, virtual scrolling, accessibility, and rich customization.

Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Installation and package setup (@syncfusion/ej2-react-dropdowns)
  • CSS imports with tailwind3 theme
  • Basic DropDownList (functional and class components)
  • Binding a data source
  • Configuring popup height and width
Data Binding & Value Binding

📄 Read: references/data-binding.md

  • Binding primitive arrays (strings, numbers)
  • Binding JSON object arrays with fields mapping (text, value, groupBy, iconCss)
  • Remote data with DataManager (OData, ODataV4, WebAPI adaptors)
  • Value binding: preselecting values, binding primitive vs. complex objects
  • Disabling individual items with fields.disabled

⚠️ Network notice: Using DataManager with remote adaptors (ODataAdaptor, ODataV4Adaptor, WebApiAdaptor) causes the component to initiate outbound HTTP requests at runtime. Ensure all remote endpoints are trusted, authenticated, and do not expose sensitive data before wiring up remote data binding in production.

Filtering

📄 Read: references/filtering.md

  • Enabling allowFiltering for search-as-you-type
  • Handling the filtering event with updateData
  • Preventing default filtering — always set args.preventDefaultAction = true in custom handlers
  • Filter types: startswith, contains, endsWith, case-sensitive options
  • Filtering by multiple fields — use Predicate with .or() to match typed text against both text and value fields (or any combination)
  • Remote/server-side filtering with minimum character guard
  • Diacritics filtering (ignoreAccent), debounce delay
  • Highlight filtered text, custom search logic
Grouping & Templates

📄 Read: references/grouping-and-templates.md

  • Grouping items with the groupBy field
  • Fixed and inline group headers
  • Custom group header template
  • Item template, value (selected) template
  • Header and footer templates
  • No-records and action-failure templates
Features & Configuration

📄 Read: references/features-and-configuration.md

  • Sorting (sortOrder: ascending, descending)
  • Virtual scrolling for large lists (enableVirtualization)
  • Popup resize (allowResize)
  • Incremental search, clear button, readonly, disabled
  • RTL support, Preact usage
Accessibility, Styling & Localization

📄 Read: references/accessibility-styling-localization.md

  • WCAG 2.2 / Section 508 compliance
  • Keyboard navigation shortcuts
  • ARIA roles and attributes
  • cssClass prop — scoped per-instance CSS class, multiple classes, conditional classes, built-in utility classes (e-error, e-success)
  • CSS class customization (wrapper, icon, popup, list items, placeholder)
  • Theming (tailwind3, material3, bootstrap5, fluent2)
  • Localization (L10n, noRecordsTemplate, actionFailureTemplate)
  • RTL layout (enableRtl)
API Reference

📄 Read: references/api.md

  • Complete properties reference with types, defaults, and usage examples
  • All methods with signatures, parameters, and return types
  • All events with argument interfaces and usage examples
  • Interface details: FieldSettingsModel, ChangeEventArgs, SelectEventArgs, PopupEventArgs, FilteringEventArgs
  • Quick-reference summary tables for properties, methods, and events
How-To Patterns

📄 Read: references/how-to.md

  • Add, remove, or modify items dynamically
  • Cascading (dependent) dropdowns
  • Multiple cascading dropdowns
  • Remote data how-to
  • Close popup on scroll, tooltip on items, icons in items
  • Value change event, clearing selected value

Quick Start Example

Step 1 — Install the package using your package manager (verify the package against the official Syncfusion npm registry before installing):

npm install @syncfusion/ej2-react-dropdowns --save

⚠️ Supply-chain notice: @syncfusion/ej2-react-dropdowns is a third-party package published by Syncfusion Inc. Always pin to a specific verified version in your package.json (e.g., "@syncfusion/ej2-react-dropdowns": "27.x.x") and validate integrity via your lockfile (package-lock.json or yarn.lock) before deploying to production.

Step 2 — Add CSS imports in src/App.css:

@import "../node_modules/@syncfusion/ej2-base/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-react-dropdowns/styles/tailwind3.css";

Step 3 — Use the component:

import { DropDownListComponent } from '@syncfusion/ej2-react-dropdowns';
import './App.css';

export default function App() {
  const sportsData: string[] = ['Badminton', 'Cricket', 'Football', 'Golf', 'Tennis'];

  return (
    <DropDownListComponent
      id="ddlelement"
      dataSource={sportsData}
      placeholder="Select a game"
    />
  );
}

Common Patterns

JSON Object Data with Fields Mapping
import { DropDownListComponent } from '@syncfusion/ej2-react-dropdowns';

export default function App() {
  const countryData = [
    { Id: 'au', Country: 'Australia' },
    { Id: 'br', Country: 'Brazil' },
    { Id: 'cn', Country: 'China' },
    { Id: 'in', Country: 'India' },
  ];
  const fields = { text: 'Country', value: 'Id' };

  return (
    <DropDownListComponent
      dataSource={countryData}
      fields={fields}
      placeholder="Select a country"
    />
  );
}
Filtering (Search-as-you-type)
import { DropDownListComponent, FilteringEventArgs } from '@syncfusion/ej2-react-dropdowns';
import { Query } from '@syncfusion/ej2-data';

export default function App() {
  const searchData = [
    { Index: 's1', Country: 'Alaska' },
    { Index: 's2', Country: 'California' },
    { Index: 's3', Country: 'Florida' },
  ];
  const fields = { text: 'Country', value: 'Index' };

  function onFiltering(args: FilteringEventArgs) {
    args.preventDefaultAction = true; // prevent built-in filter from running alongside custom logic
    let query = new Query();
    query = args.text !== '' ? query.where('Country', 'startswith', args.text, true) : query;
    args.updateData(searchData, query);
  }

  return (
    <DropDownListComponent
      dataSource={searchData}
      fields={fields}
      allowFiltering={true}
      filtering={onFiltering}
      placeholder="Select a country"
    />
  );
}
Preselect a Value
<DropDownListComponent
  dataSource={sportsData}
  value="Cricket"
  placeholder="Select a game"
/>
Grouped Items
const vegetableData = [
  { Vegetable: 'Cabbage', Category: 'Leafy and Salad', Id: 'item1' },
  { Vegetable: 'Chickpea', Category: 'Beans', Id: 'item6' },
  { Vegetable: 'Garlic',   Category: 'Bulb and Stem', Id: 'item9' },
];
const fields = { groupBy: 'Category', text: 'Vegetable', value: 'Id' };

<DropDownListComponent dataSource={vegetableData} fields={fields} placeholder="Select a vegetable" />

Key Props

PropTypePurpose
dataSourceany[] | DataManagerData for the list items
fieldsFieldSettingsModelMaps text, value, groupBy, iconCss, disabled
valuestring | numberSelected/preselected value
placeholderstringInput placeholder text
allowFilteringbooleanEnables search filtering
filteringeventHandler for custom filter logic
popupHeightstringPopup list height (default auto)
popupWidthstringPopup list width (default matches input)
sortOrderSortOrder'None', 'Ascending', 'Descending'
enableVirtualizationbooleanVirtual scroll for large data
allowResizebooleanUser-resizable popup
enabledbooleanEnable/disable entire component
readonlybooleanRead-only mode
showClearButtonbooleanShows ✕ button to clear selection
enableRtlbooleanRight-to-left layout

Common Use Cases

Simple static list → Pass string[] to dataSource, done.

Data from API → Use DataManager with WebApiAdaptor; read references/data-binding.md. ⚠️ Remote adaptors open outbound HTTP connections — ensure endpoints are trusted.

Search/filter as user types → Set allowFiltering={true}, handle filtering event; read references/filtering.md.

Categorized items → Map groupBy field; read references/grouping-and-templates.md.

Custom item layout → Use itemTemplate; read references/grouping-and-templates.md.

Large dataset (10k+ items) → Enable enableVirtualization + inject VirtualScroll; read references/features-and-configuration.md.

Dependent dropdowns → Reload second dropdown's dataSource on first's change event; read references/how-to.md.

Comments

Markdown supported