The Timeline component presents a series of events or activities in chronological order, allowing users to track the progression of time.
<div id="timeline"></div>
<script>
let timelineObj: Timeline = new Timeline({items : [{}, {}, {}, {}, {}]});
timelineObj.appendTo('#timeline');
</script>
string
| TimelineAlign
Defines the alignment of item content within the Timeline. The possible values are:
<div id="timeline"> </div>
import { Timeline, ItemModel } from '@syncfusion/ej2-layouts';
const textContent: ItemModel[] = [
{ content: 'Cart' },
{ content: 'Personal Info' },
{ content: 'Delivery Address' },
{ content: 'Payment' }
];
let timelineObj: Timeline = new Timeline({
items : textContent,
align: 'before'
});
timelineObj.appendTo('#timeline');
Defaults to TimelineAlign.After
string
Defines the CSS class to customize the Timeline appearance.
Defaults to ”
boolean
Enable or disable persisting component’s state between page reloads.
Defaults to false
boolean
Enable or disable rendering component in right to left direction.
Defaults to false
Defines the list of items.
Defaults to []
string
Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.
Defaults to ”
string
| TimelineOrientation
Defines the orientation type of the Timeline. The possible values are:
<div id="timeline"> </div>
import { Timeline } from '@syncfusion/ej2-layouts';
let timelineObj: Timeline = new Timeline({
items: [{}, {}, {}, {}],
orientation: 'horizontal'
});
timelineObj.appendTo('#timeline');
Defaults to TimelineOrientation.Vertical
boolean
Defines whether to show the timeline items in reverse order or not.
Defaults to false
string
| Function
Defines the template content for each timeline item. The template context will contain the item model.
<div id="timeline"> </div>
import { Timeline } from '@syncfusion/ej2-layouts';
let timelineObj: Timeline = new Timeline({
items: [{}, {}, {}, {}],
template: '<span>${currentItem}</span>'
});
timelineObj.appendTo('#timeline');
Defaults to ”
Adds the handler to the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event |
handler | Function |
Specifies the call to run when the event occurs. |
Returns void
Appends the control within the given HTML element
Parameter | Type | Description |
---|---|---|
selector (optional) | string | HTMLElement |
Target element where control needs to be appended |
Returns void
Adding unload event to persist data when enable persistence true
Returns void
When invoked, applies the pending property changes immediately to the component.
Returns void
Removing unload event to persist data when enable persistence true
Returns void
Returns the persistence data for component
Returns any
Returns the route element of the component
Returns HTMLElement
Handling unload event to persist data when enable persistence true
Returns void
Applies all the pending property changes and render the component again.
Returns void
Removes the handler from the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event to remove |
handler | Function |
Specifies the function to remove |
Returns void
Dynamically injects the required modules to the component.
Parameter | Type | Description |
---|---|---|
moduleList | Function[] |
? |
Returns void
EmitType<TimelineRenderingEventArgs>
Event triggers before rendering each item.
EmitType<Event>
Event callback that is raised after rendering the timeline.