Skip to content

[Tooltip] Improve structure and default styles #226

@techniq

Description

@techniq
  • Improve structure
  • Improve default styling
  • Support TooltipItem colors
  • Add default slot implementation

Instead of

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

a better structure

<Tooltip.Root let:data>
  <Tooltip.Header>{formatDate(data.date, "eee, MMMM do")}</Tooltip.Header>
  <Tooltip.List>
    <Tooltip.Item label="value" value={data.value} />
  </Tooltip.List>
</Tooltip.Root>

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions