---
components: ["Tooltip", "TooltipFooter"]
---

<script>
  import { Tooltip, TooltipFooter, Link, Button } from "carbon-components-svelte";
  import Catalog16 from "carbon-icons-svelte/lib/Catalog16";
  import Preview from "../../components/Preview.svelte";
</script>

### Default

By default, the tooltip is triggered by an information icon.

<Tooltip tooltipBodyId="tooltip-body">
  <p id="tooltip-body">
    Resources are provisioned based on your account's organization.
  </p>
</Tooltip>

### With trigger text

<Tooltip triggerText="Resource list">
  <p>
    Resources are provisioned based on your account's organization.
  </p>
</Tooltip>

### Reactive example

<FileSource src="/framed/Tooltip/TooltipReactive" />

### Directions

<Tooltip triggerText="Top" direction="top"><p>Top</p></Tooltip>
<Tooltip triggerText="Right" direction="right"><p>Right</p></Tooltip>
<Tooltip triggerText="Bottom" direction="bottom"><p>Bottom</p></Tooltip>
<Tooltip triggerText="Left" direction="left"><p>Left</p></Tooltip>

### Alignment

<Tooltip triggerText="Start" align="start"><p>Start</p></Tooltip>
<Tooltip triggerText="End" align="end"><p>End</p></Tooltip>
<Tooltip triggerText="Center" align="center"><p>Center</p></Tooltip>

### Interactive

<Tooltip triggerText="Resource list">
  <p>
    Resources are provisioned based on your account's organization.
  </p>
  <TooltipFooter selectorPrimaryFocus="#d">
    <Link href="/">Learn more</Link>
    <Button id="d" size="small">Manage</Button>
</TooltipFooter>
</Tooltip>

### Custom icon (component)

<Tooltip triggerText="Resource list" icon={Catalog16}>
  <p>
    Resources are provisioned based on your account's organization.
  </p>
</Tooltip>

### Custom icon (slot)

<Tooltip triggerText="Resource list">
  <div slot="icon" style="width: 1rem; height: 1rem; outline: 1px solid red;"></div>
  <p>
    Resources are provisioned based on your account's organization.
  </p>
</Tooltip>

### Hidden icon

<Tooltip hideIcon triggerText="Resource list">
  <p>
    Resources are provisioned based on your account's organization.
  </p>
</Tooltip>