-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tooltip plugin basic functionality added
- Loading branch information
Showing
18 changed files
with
557 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
title: Spotlights | ||
parent: Plugins | ||
nav_order: 2 | ||
--- | ||
|
||
# Tooltip Plugin Documentation | ||
|
||
The Tooltip Plugin provides a way to display helpful tooltips to users when they hover over specific elements in your application. This guide covers the installation and configuration steps to get the Tooltip plugin working with Productled. | ||
|
||
## Installation | ||
Ensure that the Productled core is installed before adding the Tooltip plugin. If you haven't installed the core library, follow the Productled Installation Guide. | ||
|
||
To install the Tooltip plugin, run: | ||
|
||
``` bash | ||
npm install @productled/tooltip | ||
``` | ||
|
||
Then, register the Tooltip plugin in your application file: | ||
|
||
```typescript | ||
import productledConf from './productled-config.json'; | ||
import { Productled } from '@productled/core'; | ||
import { TooltipPlugin } from '@productled/tooltip'; | ||
|
||
// Get the Productled instance | ||
const productled = Productled.getInstance(); | ||
|
||
// Load the configuration | ||
productled.loadConfig(productledConf); | ||
|
||
// Register the plugin | ||
productled.registerPlugin(new TooltipPlugin()); | ||
``` | ||
|
||
## Configuring Tooltips | ||
|
||
Once installed, configure tooltips through the productled-conf.json file. | ||
|
||
Example configuration for a tooltip: | ||
|
||
```json | ||
{ | ||
"hooks": [ | ||
{ | ||
"plugin": "tooltip", | ||
"trigger": { | ||
"url": "/page/subpage*", | ||
"selector": ".hover-me", | ||
"frequency": "always" | ||
}, | ||
"config": { | ||
"title": "Tooltip Title", | ||
"description": "This is a helpful tooltip description.", | ||
"link": "https://learn-more-link.com", | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
Explanation of Configuration: | ||
|
||
- plugin: Specifies the tooltip plugin. | ||
- trigger: Defines the conditions for displaying the tooltip (e.g., URL, element selector, frequency). | ||
- config: Contains the tooltip's title, description, link, and positioning. | ||
Using Tooltips | ||
|
||
After configuring the tooltips, the Productled core automatically handles the display based on the defined conditions. You can create multiple tooltips for different elements across your application. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.