syncfusion-react-list-box
Implementing Syncfusion React ListBox
The ListBox component is a versatile React dropdown-alternative that displays items in a scrollable list format. It supports single/multiple selection, custom templates, drag-and-drop, filtering, and grouping, making it ideal for building accessible, feature-rich selection interfaces.
Documentation Guide
Navigate to specific topics based on your implementation needs:
Getting Started
📄 Read: references/getting-started.md
- React app setup (Vite/Create React App)
- Installing Syncfusion packages
- CSS imports and theming
- Basic ListBox component creation
- Running the application
Selection & Events
📄 Read: references/selection.md
- Single selection mode
- Multiple selection mode
- Selection events and handlers
- Programmatic selection management
- Working with selected items
Data Binding & Structure
📄 Read: references/data-binding.md
- Array and object data binding
- Text and value properties
- Data source configuration
- Grouping data
- Hierarchical data structures
Custom Templates & Icons
📄 Read: references/icons-and-templates.md
- Icon rendering in items
- Custom item templates
- HTML content rendering
- Template variables and syntax
- Conditional rendering
Advanced Features
📄 Read: references/features.md
- Drag and drop functionality
- Filtering and search
- Sorting and grouping
- Dual ListBox (transfer list)
- Scroller configuration
- Item enable/disable
Styling & Appearance
📄 Read: references/style-and-appearance.md
- CSS class customization
- Theme integration
- Styling items and groups
- Responsive design
- Custom CSS variables
Accessibility
📄 Read: references/accessibility.md
- WCAG 2.2 compliance
- Keyboard navigation
- ARIA attributes
- Screen reader support
- RTL (right-to-left) support
How-To Guides
📄 Read: references/how-to-guides.md
- Add items dynamically
- Select items programmatically
- Enable/disable items
- Filter ListBox data
- Enable scroller for long lists
- Form integration & submission
Dual ListBox (Transfer)
📄 Read: references/dual-list-box.md
- Two-way item transfer between lists
- Toolbar operations (move up/down, transfer)
- Permission and skill assignment patterns
- Custom styling and responsive design
- Capacity limits and validation
API Reference
📄 Read: references/api.md
- Complete list of all properties with types and defaults
- All public methods with parameter details and return types
- All events with full event argument interfaces
- Sub-interfaces:
SelectionSettingsModel,ToolbarSettingsModel,FieldSettingsModel,SourceDestinationModel
Quick Start Example
Basic ListBox with single selection:
import { ListBoxComponent } from '@syncfusion/ej2-react-dropdowns';
import './App.css';
function App() {
const data = [
{ text: 'JavaScript', id: '1' },
{ text: 'TypeScript', id: '2' },
{ text: 'React', id: '3' },
{ text: 'Vue', id: '4' },
{ text: 'Angular', id: '5' }
];
const handleChange = (e) => {
console.log('Selected:', e.value);
};
return (
<ListBoxComponent
dataSource={data}
fields={{ text: 'text', value: 'id' }}
selectionSettings={{ mode: 'Single' }}
change={handleChange}
/>
);
}
export default App;
Common Patterns
Multiple Selection
<ListBoxComponent
dataSource={data}
selectionSettings={{ mode: 'Multiple' }}
/>
Checkbox Selection
Requires injecting
CheckBoxSelectionservice.
import { ListBoxComponent, SelectionSettingsModel, Inject, CheckBoxSelection } from '@syncfusion/ej2-react-dropdowns';
const selectionSettings: SelectionSettingsModel = { showCheckbox: true };
<ListBoxComponent dataSource={data} selectionSettings={selectionSettings}>
<Inject services={[CheckBoxSelection]} />
</ListBoxComponent>
With Search/Filter
<ListBoxComponent
dataSource={data}
allowFiltering={true}
filterBarPlaceholder="Search items"
/>
Custom Item Template
const itemTemplate = (props) => {
return (
<div>
<span className="icon">{props.icon}</span>
<span>{props.text}</span>
</div>
);
}
<ListBoxComponent
dataSource={data}
itemTemplate={itemTemplate}
/>
Grouping Items
<ListBoxComponent
dataSource={groupedData}
fields={{ text: 'text', groupBy: 'category' }}
/>
Key Props & Configuration
| Prop | Purpose | Example |
|---|---|---|
dataSource |
Array of items to display | [{ text: 'Item', id: '1' }] |
fields |
Maps data properties to display | { text: 'name', value: 'id' } |
selectionSettings |
Defines selection mode and checkbox display. For showCheckbox: true, inject CheckBoxSelection service |
{ mode: 'Multiple' } / { showCheckbox: true } |
allowFiltering |
Enables filter search box | true |
allowDragAndDrop |
Enables item drag-drop | true |
itemTemplate |
Custom template for items | Function returning JSX |
enabled |
Enables/disables the component | true / false |
Common Use Cases
- Select Framework - Single selection from framework list with icons
- Multi-Select Languages - Multiple selection with search filter
- Skill Picker - Custom templates with badges and descriptions
- Drag-Drop Transfer - Dual ListBox for moving items between lists
- Grouped Categories - Organizing items by category with group headers
- Searchable Item List - Large list with filter functionality
- Accessible Menu - Full keyboard navigation and screen reader support
Next Steps
- Start with Getting Started for initial setup
- Choose your use case (selection mode, templates, features)
- Read relevant reference for implementation details
- Copy code examples and customize for your needs
- Use Accessibility guide for WCAG compliance
Need help? Each reference file contains examples, edge cases, and troubleshooting tips.
More from syncfusion/react-ui-components-skills
syncfusion-react-grid
Implements Syncfusion React Grid component for feature-rich data tables and grids. Use this when working with data display, sorting, filtering, grouping, aggregates, editing, or exporting. This skill covers grid configuration, CRUD operations, virtual scrolling or infinite scrolling, hierarchy grids, state persistence, and advanced data management features for data-intensive applications.
118syncfusion-react-rich-text-editor
Implements the Syncfusion React Rich Text Editor (RichTextEditorComponent) from ej2-react-richtexteditor, supporting HTML (WYSIWYG) and Markdown editing. Use this skill for toolbar configuration, image/video/audio insertion, paste cleanup, AI assistant integration, emoji picker, slash menu, mentions, import/export Word/PDF, form validation, and source code view in React applications.
114syncfusion-react-common
Common utilities and features for Syncfusion React components. Use this skill when the user needs to implement animations, drag-and-drop, state persistence, RTL support, localization, globalization, security, templates, and advanced features for Syncfusion React components.
112syncfusion-react-themes
Use this skill when users need to apply themes, customize appearance, switch dark mode, use CSS variables, configure icons, or modify visual styling for Syncfusion React components. Covers icon library, size modes, and Theme Studio integration.
112syncfusion-react-scheduler
Implement Syncfusion React Scheduler component for calendar, event scheduling, and appointment management. Use this when building scheduling systems, calendar applications, booking systems, or time management interfaces. Covers all scheduler views (Day, Week, Month, Timeline, Agenda, Year), data binding, resource scheduling, recurring events, CRUD operations, drag-and-drop scheduling, customization, accessibility, and advanced features.
111syncfusion-react-treegrid
Implements Syncfusion React TreeGrid for hierarchical data with sorting, filtering, editing, exporting, paging, virtual scrolling, and advanced features. Supports configuration, CRUD, aggregates, templates, state persistence, and performance optimization in React applications.
110