Getting Started
16 May 20253 minutes to read
This section explains how to create a simple Skeleton, and configure its available functionalities in React.
To get started quickly with the React Skeleton component, you can check out this video.
Dependencies
The following list of dependencies are required to use the Skeleton component in your application.
|-- @syncfusion/ej2-react-notifications
|-- @syncfusion/ej2-react-base
|-- @syncfusion/ej2-notifications
|-- @syncfusion/ej2-base
Setup your development environment
To easily set up a React application, use create-vite-app
, which provides a faster development environment, smaller bundle sizes, and optimized builds compared to traditional tools like create-react-app
. For detailed steps, refer to the Vite installation instructions. Vite sets up your environment using JavaScript and optimizes your application for production.
Note: To create a React application using
create-react-app
, refer to this documentation for more details.
To create a new React application, run the following command.
npm create vite@latest my-app
To set-up a React application in TypeScript environment, run the following command.
npm create vite@latest my-app -- --template react-ts
cd my-app
npm run dev
To set-up a React application in JavaScript environment, run the following command.
npm create vite@latest my-app -- --template react
cd my-app
npm run dev
Adding Syncfusion® packages
All the available Essential® JS 2 packages are published in npmjs.com
public registry.
To install Skeleton
component, use the following command
npm install @syncfusion/ej2-react-notifications --save
The above command installs Skeleton dependencies
which are required to render the component in the React
environment.
Adding style sheet to the Application
Add Skeleton component’s styles as given below in App.css
.
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-notifications/styles/material.css";
Add Skeleton to the Application
Now, you can create Skeleton
component in the application. Add Skeleton
component in src/App.tsx
file using the following code snippet.
import { SkeletonComponent } from '@syncfusion/ej2-react-notifications';
import * as React from "react";
import * as ReactDOM from 'react-dom';
function App() {
return (
<SkeletonComponent height='15px'></SkeletonComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById('element'));
Run the application
Now run the npm run dev
command in the console to start the development server. This command compiles your code and serves the application locally, opening it in the browser.
npm run dev
The following example shows a basic Skeleton component.
import { SkeletonComponent } from '@syncfusion/ej2-react-notifications';
import * as React from "react";
import * as ReactDOM from 'react-dom';
function App() {
return (<SkeletonComponent height='15px'></SkeletonComponent>);
}
export default App;
ReactDOM.render(<App />, document.getElementById('element'));
import { SkeletonComponent } from '@syncfusion/ej2-react-notifications';
import * as React from "react";
import * as ReactDOM from 'react-dom';
function App() {
return (
<SkeletonComponent height='15px'></SkeletonComponent>);
}
export default App;
ReactDOM.render(<App />, document.getElementById('element'));