Tooltip
Description
Tooltip helperUsage
Tooltip: Component<{ content?: Component<{ data: ITask }>; api?: IApi; () => any }>;
You can import the component from "@svar-ui/svelte-gantt".
Parameters
content
- (optional) the Svelte component that includes:data
- (required) the tasks objectapi
- (required) the API gateway object for interacting with Gantt API
If the attribute is not added, then the tooltip will display the task name.
Example
The example below shows how to add the default tooltip. Do not forget to pass the api
object to Tooltip (for more details, refer to How to access Gantt API). Other usage examples see here: Adding tooltips
<script>
import { getData } from "../data";
import { Gantt, Tooltip } from "@svar-ui/svelte-gantt";
const data = getData();
let api = $state();
</script>
<Tooltip {api}>
<Gantt
tasks={data.tasks}
links={data.links}
scales={data.scales}
bind:this={api}
/>
</Tooltip>
Related articles: