Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@spectrum-web-components/popover
Advanced tools
An `<sp-popover>` is used to display transient content (menus, options, additional actions etc.) and appears when clicking/tapping on a source (tools, buttons, etc.) It stands out via its visual style (stroke and drop shadow) and floats on top of the rest
An <sp-popover>
is used to display transient content (menus, options, additional actions etc.) and appears when clicking/tapping on a source (tools, buttons, etc.) It stands out via its visual style (stroke and drop shadow) and floats on top of the rest of the interface. This component does not implement the actual overlay behavior and interactions. This is handled by the Overlay
system.
yarn add @spectrum-web-components/popover
Import the side effectful registration of <sp-popover>
via:
import '@spectrum-web-components/popover/sp-popover.js';
When looking to leverage the Popover
base class as a type and/or for extension purposes, do so via:
import { Popover } from '@spectrum-web-components/popover';
<div
style="
position: relative;
height: 100px;
"
>
<sp-popover open>
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
</sp-popover>
</div>
Default popover with no tip and no placement. Popovers will fill up the space of their containing element by default. The default popover has no padding.
<div
style="
position: relative;
height: 180px;
max-width: 320px;
"
>
<sp-popover variant="default" open>
<h2>Popover title</h2>
<p>
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
sweet roll cake danish candy biscuit halvah
</p>
</sp-popover>
</div>
To apply a managed amount of padding within your <sp-popover>
, you may choose to wrap your slotted content in an <sp-dialog>
element, as seen below:
<div
style="
position: relative;
height: 250px;
max-width: 320px;
"
>
<sp-popover open>
<sp-dialog>
<h3 slot="heading">Popover title</h3>
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
sweet roll cake danish candy biscuit halvah
</sp-dialog>
</sp-popover>
</div>
The placement
attribute can be used to customize how the <sp-popover>
points to its related content. placement="top"
will point down to the related content from the top, etc.
<div
style="
position: relative;
height: 250px;
max-width: 320px;
"
>
<sp-popover placement="top" tip open>
<sp-dialog>
<h3 slot="heading">Popover title</h3>
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
sweet roll cake danish candy biscuit halvah
</sp-dialog>
</sp-popover>
</div>
Right
<div
style="
position: relative;
height: 200px;
max-width: 320px;
"
>
<sp-popover placement="right" tip open>
<sp-dialog>
<h3 slot="heading">Popover title</h3>
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
sweet roll cake danish candy biscuit halvah
</sp-dialog>
</sp-popover>
</div>
Bottom
<div
style="
position: relative;
height: 200px;
max-width: 320px;
"
>
<sp-popover placement="bottom" tip open>
<sp-dialog>
<h3 slot="heading">Popover title</h3>
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
sweet roll cake danish candy biscuit halvah
</sp-dialog>
</sp-popover>
</div>
Left
<div
style="
position: relative;
height: 200px;
max-width: 320px;
"
>
<sp-popover placement="left" tip open>
<sp-dialog>
<h3 slot="heading">Popover title</h3>
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
sweet roll cake danish candy biscuit halvah
</sp-dialog>
</sp-popover>
</div>
FAQs
An `<sp-popover>` is used to display transient content (menus, options, additional actions etc.) and appears when clicking/tapping on a source (tools, buttons, etc.) It stands out via its visual style (stroke and drop shadow) and floats on top of the rest
The npm package @spectrum-web-components/popover receives a total of 3,792 weekly downloads. As such, @spectrum-web-components/popover popularity was classified as popular.
We found that @spectrum-web-components/popover demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.