Use the source below in your application. Try the interactive component in Playground or Examples.
import '@blukavantui/community/theme.css'
import {createProjectTimeline} from '@blukavantui/pro/project-timeline';
import '@blukavantui/pro/project-timeline.css';
export function mount(host:HTMLElement){
const output=document.createElement('p');output.setAttribute('role','status');host.append(output);
const timeline=createProjectTimeline(host,{
Resources:[{Key:"maya",Name:"Maya Chen",Position:"Product lead",Color:"Purple"},{Key:"luis",Name:"Luis Rivera",Position:"Engineer",Color:"Red"}],
ShowFilters:false,ShowDescriptions:false,AllowEditing:true,EnableBulkSave:true,ShowCapacity:true,ShowBaseline:true,WorkingDays:'1,2,3,4,5',
Dependencies:[{PredecessorKey:'research',SuccessorKey:'design',Type:'FinishStart'}],
"Items": [
{
"Key": "research", "ResourceKey":"maya", "EstimateHours":16,"ProjectTag":"Launch",
"Label": "Discover the opportunity",
"StartDate": "2026-10-05",
"EndDate": "2026-10-09",
"Progress": 100,
"Color": "Success",
"Description": "Customer interviews and a focused brief"
},
{
"Key": "design", "ResourceKey":"maya", "EstimateHours":24,
"Label": "Design the experience",
"StartDate": "2026-10-08",
"EndDate": "2026-10-16",
"Progress": 65,
"Color": "Primary"
},
{
"Key": "build", "ResourceKey":"luis", "EstimateHours":40,
"Label": "Build and connect",
"StartDate": "2026-10-12",
"EndDate": "2026-10-23",
"Progress": 25,
"Color": "Blue"
},
{
"Key": "review",
"Label": "Accessibility review",
"StartDate": "2026-10-19",
"EndDate": "2026-10-23",
"Progress": 0,
"Color": "Warning"
},
{
"Key": "launch",
"Label": "Launch",
"StartDate": "2026-10-26",
"IsMilestone": true,
"Color": "Success"
}
],
"RangeStart": "2026-10-01",
"RangeEnd": "2026-10-31",
"TodayDate": "2026-10-14",
"AccessibleLabel": "October release plan",
"IsInteractive": true
},{
SaveRequested:(requestId,items)=>{
// Demo acknowledgement. Validate and persist on your server before returning success.
queueMicrotask(()=>timeline.update({SaveResultRequestId:requestId,SaveResultSuccess:true,SaveResultItems:items,SaveResultMessage:'Schedule accepted for this page session.'}));
},
ItemsChanged:(_items,key)=>{output.textContent='Schedule changed: '+key;},
FiltersChanged:(resource,start,end,search,kind)=>{output.textContent=`Filter: ${resource||'everyone'}, ${start} to ${end}, ${kind||'all'}, ${search}`;},
ItemClick:key=>{output.textContent='Open task: '+key;},
Error:message=>{output.textContent=message;},
});
// Load your data, then call timeline.update({Items:tasks,IsLoading:false}).
// The built-in editor uses DatePicker. Persist accepted edits in SaveRequested.
return {destroy(){timeline.destroy();output.remove();}};
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()