Syncfusion React Common

syncfusion/react-ui-components-skills/skills/syncfusion-react-common

作者 syncfusion6fb1c883a8412b611b95f839e0cb06e1fc8170a8无许可证收录于 2026年10月9日更新于 2026年10月9日

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.

AI 生成的概览

指导实现 Syncfusion React 组件的通用功能,如动画、拖放、RTL、本地化和状态持久化。

功能
该技能为 Syncfusion React 组件的通用能力提供参考指导:安装与框架集成、动画、拖放、模板定制、状态持久化、RTL、本地化与全球化,以及安全实践。它包含安装包、导入主题、注册许可证密钥和初始化组件的快速入门代码示例。它产出的是实现说明,而不是可运行脚本。
适用场景
当使用 Syncfusion 组件构建 React 应用,并需要添加动画、拖放、从右到左布局、多语言本地化或组件状态持久化等横切功能时使用。它也适用于初始框架搭建和许可证注册。
运行要求
需要一个 React 项目,并通过 npm 安装 Syncfusion React 组件包;还需要通过环境变量设置 Syncfusion 许可证密钥,并使用 syncfusion-license 命令激活。安装包需要网络访问。该技能不附带脚本,只有参考文档。

Common Features in Syncfusion React Components

Syncfusion React components include comprehensive common utilities and features that enhance user experience, ensure cross-cultural support, and provide foundational capabilities across all components. This skill covers installation setup, animations, globalization, state management, and security considerations for building robust React applications.

Table of Contents

Navigation Guide

Getting Started & Framework Setup

📄 Read: references/getting-started.md [blocked]

  • Framework integration (Next.js, Remix, Vite, Preact, SharePoint)
  • Package installation and CSS imports
  • Component initialization
  • Quick start examples

Globalization

📄 Read: references/globalization.md [blocked]

  • Right-to-left (RTL) support for Arabic, Hebrew, Persian languages
  • Localization (l10n) for multi-language support
  • Internationalization (i18n) with CLDR data
  • Number and currency formatting
  • Date and time formatting

Advanced Features & Utilities

📄 Read: references/advanced-features.md [blocked]

  • Animation effects (FadeIn, ZoomOut, SlideUp, etc.)
  • Animation timing (duration, delay, global settings)
  • Drag-and-drop interactions (Draggable, Droppable)
  • Template customization and optimization
  • State persistence with enablePersistence
  • Security best practices and HTML sanitization

Quick Start

Install Syncfusion React component package and theme package

bash
npm install @syncfusion/ej2-react-grids@latest @syncfusion/ej2-tailwind3-theme@latest --save

Note: The @syncfusion/ej2-base package is a dependency for all Syncfusion components and will be automatically installed when you install any Syncfusion React package. You don't need to explicitly add it to your package.json file.

Import Styles

css
@import "../node_modules/@syncfusion/ej2-tailwind3-theme/styles/grid/index.css";

Register License Key

Step 1: Set the environment variable:

bash
# Windowssetx SYNCFUSION_LICENSE "Your_License_Key_Here"
# Mac/Linuxexport SYNCFUSION_LICENSE='Your_License_Key_Here'

Step 2: Activate the license using NPX command:

bash
npx syncfusion-license activate

Note: For alternative license registration methods, kindly refer to the Syncfusion license key registration documentation.

Basic Component Setup

typescript
import * as React from 'react';import { GridComponent, ColumnsDirective, ColumnDirective, Inject, Page } from '@syncfusion/ej2-react-grids';
function App() {  const data = [    { OrderID: 10248, CustomerID: 'VINET', Freight: 32.38 },    { OrderID: 10249, CustomerID: 'TOMSP', Freight: 11.61 }  ];
  return (    <GridComponent dataSource={data} allowPaging={true}>      <ColumnsDirective>        <ColumnDirective field='OrderID' width='100' />        <ColumnDirective field='CustomerID' width='100' />        <ColumnDirective field='Freight' width='100' format="C2" />      </ColumnsDirective>      <Inject services={[Page]} />    </GridComponent>  );}
export default App;

Common Features

Enable State Persistence

typescript
<GridComponent dataSource={data} enablePersistence={true}>  {/* Component content */}</GridComponent>

Enable RTL Support

typescript
import { enableRtl } from '@syncfusion/ej2-base';
// Global RTL enablementenableRtl(true);
// OR per-component<ListViewComponent enableRtl={true} />

Add Animation Effects

typescript
import { Animation } from '@syncfusion/ej2-base';
useEffect(() => {  const animation = new Animation({ duration: 5000, delay: 2000 });  animation.animate(element, { name: 'FadeOut' });}, []);

Implement Drag-and-Drop

typescript
import { Draggable, Droppable } from '@syncfusion/ej2-base';
useEffect(() => {  const draggable = new Draggable(document.getElementById('draggable'), { clone: false });  const droppable = new Droppable(document.getElementById('droppable'), {    drop: (e) => {      e.droppedElement.textContent = 'Dropped!';    }  });}, []);

来源与署名

来源:syncfusion/react-ui-components-skills位于skills/syncfusion-react-common提交6fb1c88

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架