techniq / layerchart

Composable Svelte chart components to build a wide range of visualizations
https://www.layerchart.com
MIT License
512 stars 10 forks source link

[Tooltip] Improve structure and default styles #226

Open techniq opened 1 month ago

techniq commented 1 month ago

TODO

Instead of

<Tooltip header={(data) => formatDate(data.date, "eee, MMMM do")} let:data>
  <TooltipItem label="value" value={data.value} />
</Tooltip>

a better structure

<Tooltip let:data>
  <TooltipHeader>{formatDate(data.date, "eee, MMMM do")}</TooltipHeader>
  <TooltipItem label="value" value={data.value} />
</Tooltip>

With this structure, TooltipHeader will need to use col-span-full since it will be within the default slots's grid

techniq commented 1 month ago

Reference for improved default styling

shadcn

image image

tremor

image image image image image

See also: