mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
29 lines
822 B
Text
29 lines
822 B
Text
<script>
|
|
import { TooltipDefinition } from "carbon-components-svelte";
|
|
import Preview from "../../components/Preview.svelte";
|
|
</script>
|
|
|
|
### Default
|
|
|
|
<TooltipDefinition tooltipText="IBM Corporate Headquarters is based in Armonk, New York.">
|
|
Armonk
|
|
</TooltipDefinition>
|
|
|
|
### Custom tooltip direction and alignment
|
|
|
|
Customize the tooltip menu direction and alignment through the `direction` and `align` props.
|
|
|
|
By default, `direction` is `"bottom"` and `align` is `"center"`.
|
|
|
|
<TooltipDefinition direction="top" align="start" tooltipText="IBM Corporate Headquarters is based in Armonk, New York.">
|
|
Armonk
|
|
</TooltipDefinition>
|
|
|
|
### Custom tooltip slot
|
|
|
|
<TooltipDefinition>
|
|
Armonk
|
|
<span slot="tooltip" style="color: red">
|
|
IBM Corporate Headquarters is based in Armonk, New York.
|
|
</span>
|
|
</TooltipDefinition>
|