syncfusion-react-tabs
Implement and customize Tab components in Syncfusion React applications. Use this skill whenever the user needs to create tabbed interfaces, manage tab content rendering, configure header positioning, enable drag-and-drop reordering, or customize tab styling. Essential for building navigation layouts, content organization, responsive tab controls, localized tabs, and accessible tab interactions.
What this skill does
# Implementing Tabs in Syncfusion React
The Tab component organizes related content into tabbed sections with headers, allowing users to switch between views. This comprehensive skill guides you through setup, customization, content rendering strategies, API methods, events, accessibility, animations, persistence, and advanced features like drag-and-drop reordering.
## Table of Contents
- [When to Use This Skill](#when-to-use-this-skill)
- [Component Overview](#component-overview)
- [Documentation and Navigation Guide](#documentation-and-navigation-guide)
- [Quick Start Example](#quick-start-example)
- [Common Patterns](#common-patterns)
- [Key Properties Overview](#key-properties-overview)
- [Methods & API Reference](#methods--api-reference)
- [Events & Event Arguments](#events--event-arguments)
- [Animation & Advanced Settings](#animation--advanced-settings)
- [Related Skills](#related-skills)
## When to Use This Skill
- **Creating tabbed interfaces** with header-based navigation
- **Organizing content** into logical sections or views
- **Building responsive layouts** with scrollable or popup overflow handling
- **Customizing header styling** and icon positioning
- **Managing content rendering** performance (lazy loading, dynamic, or initial render)
- **Implementing drag-and-drop** tab reordering for user customization
- **Adding localization support** for international applications
- **Ensuring accessibility compliance** (WCAG, ARIA, keyboard navigation)
- **Styling tabs** with custom CSS or theme customization
- **Programmatically managing tabs** (add, remove, select, hide/show)
- **Handling tab-related events** (selection, drag-drop, add, remove)
- **Preserving user preferences** with state persistence
- **Implementing smooth animations** and transitions
## Component Overview
The Tab component is a navigation control that displays content organized into tabs. Each tab has a header and associated content. Tabs support:
- **Multiple header positions** (top, bottom, left, right)
- **Overflow handling** (scrollable navigation or popup mode)
- **Flexible content rendering** (on-demand, dynamic, or initial load)
- **Drag-and-drop reordering** for interactive tab management
- **Full accessibility** with ARIA attributes and keyboard navigation
- **Extensive customization** via CSS and theme options
- **Internationalization** through localization APIs
- **Animation effects** for content transitions
- **State persistence** across page reloads
- **HTML sanitization** for security
## Documentation and Navigation Guide
### Getting Started
๐ **Read:** [references/getting-started.md](references/getting-started.md)
- Package dependencies and installation
- Vite and Create React App setup
- CSS imports and theme configuration
- Basic tab initialization with JSON items
- Minimal working example and running the app
**When to read:** Start here to set up a basic Tab component in your React application.
### Header Styling & Customization
๐ **Read:** [references/header-styling.md](references/header-styling.md)
- Built-in header style classes (e-fill, e-background, e-accent)
- Icon positioning options (left, right, top, bottom)
- Icon and header customization with CSS classes
- Code examples for styled headers
- Styling content and hover states
**When to read:** Use this when you need to customize tab header appearance, add icons, or apply predefined styles.
### Orientation & Overflow Modes
๐ **Read:** [references/orientation-overflow.md](references/orientation-overflow.md)
- Header placement positions (top, bottom, left, right)
- Scrollable mode with navigation arrows
- Popup mode with dropdown display
- Touch and swipe support
- Width constraints and responsive behavior
**When to read:** Use this when you need to control header position, handle many tabs with overflow, or build responsive layouts.
### Content Rendering Strategies
๐ **Read:** [references/content-rendering.md](references/content-rendering.md)
- On-demand rendering (lazy loading, default mode)
- Dynamic rendering for state-isolated tabs
- Initial rendering for state preservation
- Performance vs. state considerations
- Choosing the right rendering mode
**When to read:** Use this to optimize tab content performance or preserve user interactions across tab switches.
### Drag and Drop Reordering
๐ **Read:** [references/drag-drop-reordering.md](references/drag-drop-reordering.md)
- Enabling drag-and-drop with allowDragAndDrop
- Handling drag events (onDragStart, dragging, dragged)
- Preventing drag/drop for specific items
- Tab-to-tab drag and drop
- Dragging tabs to external sources (TreeView)
- Drag area constraints
**When to read:** Use this to allow users to reorder tabs or integrate tab dragging with other components.
### Accessibility & Localization
๐ **Read:** [references/accessibility-localization.md](references/accessibility-localization.md)
- WCAG 2.2 and Section 508 compliance
- ARIA attributes and roles for tabs
- Keyboard navigation (arrows, Home, End, Enter, Escape)
- Screen reader support
- Localization with L10n class
- Right-to-left (RTL) language support
**When to read:** Use this when building accessible applications or supporting multiple languages.
## Quick Start Example
Here's a minimal Tab component setup:
```jsx
import React from 'react';
import { TabComponent, TabItemsDirective, TabItemDirective } from '@syncfusion/ej2-react-navigations';
import '@syncfusion/ej2-base/styles/tailwind3.css';
import '@syncfusion/ej2-buttons/styles/tailwind3.css';
import '@syncfusion/ej2-popups/styles/tailwind3.css';
import '@syncfusion/ej2-react-navigations/styles/tailwind3.css';
export default function TabExample() {
const tabItems = [
{
header: { text: 'Home' },
content: 'Welcome to the home tab'
},
{
header: { text: 'Profile' },
content: 'User profile information'
},
{
header: { text: 'Settings' },
content: 'Application settings'
}
];
return (
<TabComponent>
<TabItemsDirective>
{tabItems.map((item, index) => (
<TabItemDirective key={index} header={item.header} content={item.content} />
))}
</TabItemsDirective>
</TabComponent>
);
}
```
## Common Patterns
### Pattern 1: Styled Tabs with Icons
```jsx
<TabComponent className="e-fill">
<TabItemsDirective>
<TabItemDirective
header={{ text: 'Home', iconCss: 'e-icons e-home' }}
content="Home content"
/>
<TabItemDirective
header={{ text: 'Profile', iconCss: 'e-icons e-user' }}
content="Profile content"
/>
</TabItemsDirective>
</TabComponent>
```
### Pattern 2: Vertical Tabs on the Left
```jsx
<TabComponent headerPlacement="Left">
<TabItemsDirective>
<TabItemDirective header={{ text: 'Tab 1' }} content="Content 1" />
<TabItemDirective header={{ text: 'Tab 2' }} content="Content 2" />
</TabItemsDirective>
</TabComponent>
```
### Pattern 3: Lazy-Loaded Content (Default)
```jsx
<TabComponent>
<TabItemsDirective>
<TabItemDirective
header={{ text: 'Lazy Tab' }}
content={() => <ExpensiveComponent />}
/>
</TabItemsDirective>
</TabComponent>
```
### Pattern 4: Draggable Tabs
```jsx
<TabComponent allowDragAndDrop={true}>
<TabItemsDirective>
<TabItemDirective header={{ text: 'Tab 1' }} content="Content 1" />
<TabItemDirective header={{ text: 'Tab 2' }} content="Content 2" />
</TabItemsDirective>
</TabComponent>
```
## Key Properties Overview
| Property | Type | Default | Purpose |
|----------|------|---------|---------|
| `headerPlacement` | String | `'Top'` | Position of tab headers: `Top`, `Bottom`, `Left`, `Right` |
| `overflowMode` | String | `'Scrollable'` | Overflow handling: `Scrollable` or `Popup` |
| `loadOn` | String | `'Demand'` | Content rendering: `Demand`, `Dynamic`, or `Init` |
| `allowDragAndDrop` | Boolean | `false` | Enable tab reordering via drag and drop |
| `showCloseButton` | Boolean | `fRelated in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4โv5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.