mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 20:09:35 +00:00
feat(tooltip-icon): make tooltipText slottable
This commit is contained in:
parent
c37890d4b4
commit
6b75607dce
6 changed files with 48 additions and 16 deletions
|
@ -1,5 +1,8 @@
|
|||
<script>
|
||||
/** Specify the tooltip text */
|
||||
/**
|
||||
* Specify the tooltip text.
|
||||
* Alternatively, use the "text" slot
|
||||
*/
|
||||
export let tooltipText = "";
|
||||
|
||||
/**
|
||||
|
@ -56,6 +59,8 @@
|
|||
hidden = false;
|
||||
}}"
|
||||
>
|
||||
<span id="{id}" class:bx--assistive-text="{true}">{tooltipText}</span>
|
||||
<span id="{id}" class:bx--assistive-text="{true}"
|
||||
><slot name="text">{tooltipText}</slot></span
|
||||
>
|
||||
<slot />
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue