Skip to content

Timeline Tags

Add tags to timeline items for categorization, labeling, and quick visual identification.

PropertyTypeDescription
titlestringThe tag label text
colorstringBackground color (e.g., '#dc2626', 'red')
onclickfunctionClick handler: (event, item, tag) => void

Add tags to timeline items:

<html>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/style.min.css" />
<script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/index.min.js"></script>

<div id="root"></div>

<script>
const { Timeline } = calendarjs;

Timeline(document.getElementById('root'), {
    data: [
        {
            title: 'Project Kickoff',
            date: '2025-01-15',
            tags: [
                { title: 'Meeting', color: '#3b82f6' },
                { title: 'Important', color: '#dc2626' }
            ]
        },
        {
            title: 'Design Review',
            date: '2025-02-01',
            tags: [
                {
                    title: 'Design',
                    color: '#8b5cf6',
                    onclick: (e, item, tag) => {
                        console.log('Clicked tag:', tag.title, 'on item:', item.title);
                    }
                }
            ]
        },
        {
            title: 'Development Sprint',
            date: '2025-02-15',
            tags: [
                { title: 'Dev', color: '#10b981' },
                { title: 'Sprint 1', color: '#f59e0b' }
            ]
        }
    ]
});
</script>
</html>