Hint
Hint is a very common UI effect to help user easy understand particular nouns.
With <msc-hint />, developers could adopt this feature to web page easier.
Check the following examples and adjust configs to see what can <msc-hint /> do ?
Basic Usage
<msc-hint /> is a web component. All we need to do is put the required script into your HTML document. Then follow <msc-hint />'s html structure and everything will be all set.
Required Script
Structure
Put <msc-hint /> into HTML document. It will have different functions and looks with attribute mutation.
JavaScript Instantiation
<msc-hint /> could also use JavaScript to create DOM element. Here comes some examples.
Style Customization
Developers could apply styles to decorate <msc-hint />'s looking.
Otherwise, developers could also apply ::part() to direct style panel.
<msc-hint />also build-in data attribytes for panel display position.
-
-
data-vertical-align:start || end. Default is
end. -
-
data-horizontal-align:start || center || end. Default is
center.
Attributes
<msc-hint /> supports some attributes to let it become more convenience & useful.
hover
Set hover able for <msc-hint />. Once setting, <msc-hint /> will popup panel when user hover trigger. Default is false(not set).
autoposition
Set autoposition for <msc-hint />. Once setting, <msc-hint /> will auto position popup panel. Default is false(not set).
Property
| Property Name | Type | Description |
|---|---|---|
hover
|
Boolean | Getter / Setter for hover. Default is false. |
autoposition
|
Boolean | Getter / Setter for autoposition. Default is false. |