Socket
Book a DemoInstallSign in
Socket

@sat/popover

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sat/popover

Popover component for Angular

1.0.0-alpha.0
Source
npmnpm
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Popover Component for Angular

Usage

Quickstart

Wrap any component you want to display in a popover with sat-popover.

<sat-popover>
  <app-contact-overview [contact]="myContact"></app-contact-overview>
</sat-popover>

Next, hook the popover to an anchor element.

<button [satPopoverAnchorFor]="contactPopover">
  See Details
</button>

<sat-popover #contactPopover>
  <app-contact-overview [contact]="myContact"></app-contact-overview>
</sat-popover>

Now, whenever the button is clicked, the <app-contact-overview> popover will appear over the button. If you instead want the popover to appear below the anchor:

<sat-popover #contactPopover yPosition="below">
  <!-- ... -->
</sat-popover>

You can use the following to position the popover around the anchor:

InputTypeDefault
xPosition'before' | 'center' | 'after''center'
yPosition'above' | 'center' | 'below''center'
overlapAnchorbooleantrue

Note: When the xPosition and yPosition are both 'center', overlapAnchor will have no effect.

If you want to respond to events other than anchor clicks, you can disable the click handler and implement your own:

<button [satPopoverAnchorFor]="contactPopover" satDisableClick>
  See Details
</button>
@ViewChild(SatPopoverAnchor) anchor: SatPopoverAnchor;

openContactPopover(): void {
  this.anchor.openPopover();
}

Styling

TODO

Development

Building

npm build

Watching

npm watch

Demo server

npm start

Other

Built with Angular CLI and ng-packagr.

TODO

  • Tests 😏
  • Directionality support
  • Animation callbacks
  • Disable escape/backdrop behavior and provide stream of events
  • Make it easy to switch scroll strategies
  • Review API consistency with Angular Material
  • Stop patching globally Rx
  • Support other methods of building popovers
  • Allow more configurability to the focus trap

FAQs

Package last updated on 19 Sep 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.