TLDR: Exploring the robust features of the new Syncfusion React Timeline, highlighting its orientation, items alignment, and customization of displaying items using templates. You can also find the steps to integrate it into your React app.
We’re delighted to introduce the new Syncfusion React Timeline component in the Essential Studio 2024 Volume 1 release.
The React Timeline component offers a visually compelling and user-friendly way to display a series of data in chronological order. It is ideal for showcasing user activities, tracking progress, narrating historical timelines, and more.
Like a roadmap infographic, a timeline displays a sequence of data that makes it easier to understand the order of events and get a clear picture of what happened and when enabling users to grasp the flow of time-related information in a web application.
In this blog, we’ll explore the key features of the React Timeline component and the steps to get started!
The React Timeline component is perfect for a variety of scenarios, including:
The key features of the Timeline component are as follows:
The React Timeline component has two orientation modes:
The Timeline component supports enhancing each item with supplementary information alongside the main content. Placed opposite to the main content, this additional information enriches the context of every item, making it a valuable addition to the user experience.
The React Timeline component supports aligning the items’ content and opposite content as follows:
Display timeline items in reverse order, considering the alignment of items, offering flexibility and enhancing the user experience.
The React Timeline component allows you to customize the default appearance, including styling dot items and templating content, providing high flexibility and control over the timeline’s presentation.
Let’s create a React application and configure the Syncfusion React Timeline component.
First, ensure you have all the prerequisites to run a React app. Then, create a React app using the below command.
npx create-react-app my-app
Syncfusion React packages are available in the NPM registry. To install the packages required for the Timeline component, use the following command.
npm install @syncfusion/ej2-react-layouts --save
Now, import the required CSS styles for the Timeline component and dependency styles in the src/App.css file. Refer to the following code.
@import '../node_modules/@syncfusion/ej2-base/styles/material3.css'; @import '../node_modules/@syncfusion/ej2-layouts/styles/material3.css';
We have completed all the necessary configurations for rendering the Syncfusion React components. Now, let’s add the Timeline component by following these steps:
import { TimelineComponent, ItemsDirective, ItemDirective } from '@syncfusion/ej2-react-layouts'; import './App.css'; function App() { return ( <div id='timeline' style={{ height: "350px" }}> <TimelineComponent> <ItemsDirective> <ItemDirective content='Order Confirmed' /> <ItemDirective content='Shipped' /> <ItemDirective content='Out For Delivery' /> <ItemDirective content='Delivered' /> </ItemsDirective> </TimelineComponent> </div> ); } export default App;
Finally, run the application in the browser using the following command.
npm start
Once the web server is loaded, you can find the following output by opening the React app in the browser at port localhost:3000.
After executing the above code examples, we will get the following output.
For more details, refer to the React Timeline component demos and documentation.
The Timeline component is also available on the following platforms.
Platform | Live Demo | Documentation |
Thanks for reading! This blog shows the features of the new Syncfusion React Timeline component that rolled out in our 2024 Volume 1 release. These features are also listed on our Release Notes and the What’s New pages. Try out the component and share your feedback as comments on this blog.
You can also reach us through our support forums, support portal, or feedback portal. We’re here to assist you every step of the way!