Tooltip library for svelte
npm install svelte-hintSvelte library for tooltips internally powered by the awesome Fluent UI with sensible default values.
Check out the Demo to see it in action.
!version badge
!downloads badge
!dependency count
!minzip size badge
!types badge
- Automatic positioning & overflow handling on screen edges (Fluent UI).
- Fully typed.
- Sensible default values.
- Use text or custom html/components as tooltips.
``bash`
npm install svelte-hint
`svelte
`
`svelte
Some custom html
`
| Prop | Type | Default | Description |
| ----------- | ----------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- |
| text | string | '' | Text to be used as the tooltip. If empty the slot will be used. |placement
| | Placement | auto | See the Fluent UI docs. |boundary
| | HTMLElement \| string | 'clippingAncestors' | See the Fluent UI docs. |offset
| | Options | 4 | See the Fluent UI docs. |auto
| | boolean \| 'start' \| 'end' | false | Use the autoPlacement middleware. If set placement will be ignored. |
#### hint
> Only works if the text props is empty. Otherwise the slot is ignored.
If you don't want to use the pre-styled tooltip you are free to use whatever html / svelte code you'd like as the tooltip.
`svelte``
Hover me
Some custom html