Tooltips are small textual hints displayed when a user hovers over a UI element.
textpositiontopbottomleftrightcolorblackaccentsoftdangermaxWidthdelaywrapperProps<div> element, such as class or style.defaulttooltiptext prop.<Tooltip text="This is a tooltip">
<Button>Hover me</Button>
</Tooltip><Tooltip position="top" />
<Tooltip position="left" />
<Tooltip position="right" />
<Tooltip position="bottom" /><Tooltip color="soft" />
<Tooltip color="black" />
<Tooltip color="accent" />
<Tooltip color="danger" />You can use the tooltip slot to add advanced content to the tooltip.
<Tooltip>
<Button>Hover me</Button>
{#snippet tooltip()}
<div>
<div>This is a tooltip</div>
<Callout type="info">It can contain any content</Callout>
</div>
{/snippet}
</Tooltip>By default, the maximum width of the tooltip is set to 300px. If the text is longer
than this, it will wrap to the next line. You can change this value by setting the maxWidth prop.
<Tooltip
text="This is a very long text with a lot of characters and words. Let's see how this is displayed in a tooltip"
maxWidth={200}
>
<Button>Hover me</Button>
</Tooltip>By default, the tooltip is shown 100ms after hovering. You can change this value by
setting the delay prop.
<Tooltip text="Shows after 1 second" delay={1000}>
<Button>Hover me</Button>
</Tooltip>You can disable the tooltip by setting the disabled prop.
<Tooltip disabled text="Disabled Tooltip">
<Button>Hover me</Button>
</Tooltip>