Skip to main content

taskTypes

Description​

Optional. An array of objects containing the tasks types data

Usage​

taskTypes?: {
id: string;
label?: string;
}[];

Parameters​

  • id - (required) the task type ID: "task", "summary", "milestone" or any custom task type
  • label - (optional) the task type name shown in the UI

Example​

<script>
import { getData } from "./common/data";
import { Gantt } from "@svar-ui/svelte-gantt";

const data = getData();
const taskTypes = [
{ id: "task", label: "Project Task" },
{ id: "summary", label: "Project" },
{ id: "milestone", label: "Milestone" },
];

</script>

<Gantt tasks={data.tasks} {taskTypes} />
info

Instructions with an example of adding a new custom task type you can find here: Adding a custom task type


Related article: Defining task types