Timeline gantt — Calendar block
Freecalendar-timeline-gantt · for app, projects pages
Timeline gantt
Task rows on a shared supplied time axis, using the merchant's own dates and progress only.
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/calendar-timeline-ganttUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import CalendarTimelineGantt from '@/components/trame/blocks/calendar/calendar-timeline-gantt.vue'
const props = {
title: "Project timeline",
range: {
start: 0,
end: 100,
label: "Working period — relative markers",
ticks: [
{
value: 10,
label: "Start"
},
{
value: 50,
label: "Middle"
}
]
},
items: [
{
id: "preparer",
label: "Prepare the materials",
start: 5,
end: 35,
dates: "Preparation phase",
baseline: {
start: 5,
end: 25,
dates: "Preparation originally planned for markers 5 to 25"
},
progress: 100,
detail: "The materials are ready. The workshop has approved the samples.",
status: "Approved"
},
{
id: "assembler",
label: "Assemble the notebook",
start: 35,
end: 85,
dates: "Production phase",
baseline: {
start: 30,
end: 75,
dates: "Assembly originally planned for markers 30 to 75"
},
progress: 40,
detail: "The first batch is being assembled; proofreading comes next.",
status: "In progress"
}
],
open: "task"
}
</script>
<template>
<CalendarTimelineGantt v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section’s heading |
| items* | Item[] | null | Datathe items shown, in order |
| range* | Range | the axis: its start, end, unit and marks |
| open | string | Actiona named action of the page |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 12 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Datathe item’s id |
| parentId | string | Datathe id of the item it belongs under, if any |
| label* | string | Wordsthe item’s name |
| start | number | axis coordinate in the same unit as range, e.g. epoch milliseconds or trace milliseconds |
| end | number | axis coordinate where it ends, in the same unit as start |
| dates | string | Wordsits dates, as the host writes them |
| baseline | Baseline | the original schedule, to compare with |
| progress | number | how far along it is, 0 to 100 |
| owners | Owner[] | Datawho is in charge of it |
| status | string | Wordsits status, in the host’s words |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
| detail | string | Wordsone more line about it |
Baseline items[].baseline · 3 props
| Prop | Type | Description |
|---|---|---|
| start* | number | where it started, in the same unit as the item’s start |
| end* | number | where it ended, in the same unit as the item’s end |
| dates | string | Wordsthe original schedule in the host’s words |
Owner items[].owners[] · 6 props
| Prop | Type | Description |
|---|---|---|
| id | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe person’s name |
| role | string | Wordstheir role or job title |
| company | string | Wordswhere they work |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| url | string | Designa page about them |
Range range · 6 props
| Prop | Type | Description |
|---|---|---|
| start* | number | where the axis starts, in the axis unit |
| end* | number | where the axis ends, in the axis unit |
| label* | string | Wordsthe range’s name, as shown |
| unit | string | Wordsunit of the supplied axis coordinates, e.g. ms |
| ticks | Tick[] | the marks along the axis, each a value and a label |
| today | number | where today sits, in the axis unit |
Tick range.ticks[] · 2 props
| Prop | Type | Description |
|---|---|---|
| value* | number | where the mark sits, in the axis unit |
| label* | string | Wordswhat the figure is |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
| itemsLabel | string | Wordswhat the rows are, heading their column and naming the list ("Projects"); "Tasks" without it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
open - Reads
tasksfrom your app
A calendar section, for app, projects pages.
More calendar blocks
- Day: one day on an hour axis with its events wide, and the day’s list beside it on wide screens, for a full day of appointments.
- Month: a month at a glance with its busy days, the month’s agenda beside or under it.
- Sidebar month and layers: the side pane beside a calendar view: a mini month to pick the day, then the calendars in folding groups with a checkbox each.
- Sidebar week strip: a narrow panel or a phone: the selected week as seven raised day tiles, the calendars as toggle chips under it.
- Slot picker slots: an appointment page: the free slots of a day to pick from, not a full calendar.
- Team schedule columns: one day of a team or rooms: a column per person on a time axis, to see who is free when.
- Week appointments strip: A seven-day strip of readable event cards for the team’s own weekly appointments, with no inferred availability.
- Week: a week on an hour axis, a column per day with events sized by their length, to see when the week is busy; an agenda by day on a phone.