Tooltip(Bootstrap) component for Svelte
npm install sv-bootstrap-tooltipnpm install --save-dev sv-bootstrap-tooltip @rollup/plugin-replace`
2. Add below code in your rollup config`js
import replace from '@rollup/plugin-replace';
..
..
..
plugins: [
..., // Other Plugins
..., // Other Plugins
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
include: '/node_modules/',
})
]
`$3
Bootstrap CSS needs to be present globally in projectUsage
$3
#### Example
`html
Tooltip
`$3
You can pass the any html between opening and closing tag of
Tooltip Element#### Example
`html
Tooltip
with
HTML
`$3
This option is used to define the placement of tooltip on an
triggerElement. By default the placement is top#### Example
`html
Tooltip
`#### Complete Placement Options
Options are similar to Vanilla Bootstrap
|Placement|Description|
|--- |--- |
|auto|Placements will choose the side with most space and arrow will be in the center of trigger element|
|top|Placements will be on top and arrow will be in the center of trigger element|
|bottom|Placements will be bottom and arrow will be in the center of trigger element|
|right|Placements will be right and arrow will be in the center of trigger element|
|left|Placements will be left and arrow will be in the center of trigger element|
$3
This option should tell the
Tooltip to filp side if there is no space on the prefered side#### Example
`html
`
$3
|Name|Type|Default|Description|
|--- |--- |--- |--- |
|open|boolean|false|This option is used to manage the Tooltip manually.|
|flip|boolean|true|This option should tell the
Tooltip to filp side if there is no space on the prefered side.|
|trigger|string|hover|focus|How tooltip is triggered - click|hover|focus. You may pass multiple triggers; separate them with a |.
|offset|[?number, ?number] or Function(Definition)|[0, 4]|The offset modifier lets you displace tooltip element from triggerElement element.|
|placement|string|top|This option is used to define the placement of tooltip on an triggerElement.|
|onOpened|function|Empty function(noop)|Can be used for callbacks after the tooltip is opened.|
|onClosed|function|Empty function(noop)|Can be used for callbacks after the tooltip is closed.|___
NOTE
> For only manual triggering just pass empty string
""` to trigger option and use open option to handle the tooltip manually