npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lazycuh/angular-anchored-floating-box

v4.0.1

Published

An easy, declarative way to render a floating box with arbitrary content anchored to an element.

Readme

angular-anchored-floating-box

An easy, declarative way to render a floating box with arbitrary content anchored to an element.

Table of contents

Angular compatibility

| This library | Angular | | ------------ | ------- | | 4.x.x | 20.x.x | | 3.x.x | 19.x.x | | 2.x.x | 19.x.x | | 1.x.x | 16 - 18 |

Installation

  • npm
    npm i -S @lazycuh/angular-anchored-floating-box
  • pnpm
    pnpm i -S @lazycuh/angular-anchored-floating-box
  • yarn
    yarn add @lazycuh/angular-anchored-floating-box

Available APIs

These are the symbols that are available from this package

TriggerFloatingBoxForDirective

Inputs

| Name | Type | Description | | ------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | lcTriggerFloatingBoxFor | AnchoredFloatingBox | Required input that accepts a template reference variable to a AnchoredFloatingBox component that specifies the content of the floating box, the floating box is anchored to the HTMLElement to which this input is applied. |

AnchoredFloatingBox

Inputs

| Name | Type | Description | | ------- | ----------------- | ---------------------------------------- | | class | string | Optional CSS class attribute to add. | | theme | light | dark | Optional theme. Default is light. |

Outputs

| Name | Type | Description | | -------------- | ------------ | ----------------------------------------- | | closed | () => void | Called after the floating box is closed. | | beforeOpened | () => void | Called before the floating box is opened. | | opened | () => void | Called after the floating box is opened. |

Methods

  • AnchoredFloatingBox.setDefaultTheme(theme): Set the default theme that will be used for all future floating boxes. Use this method if you want to set the theme once instead of each time you render the floating box.

Example:

@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: 'lc-test',
  // Import the directive and the component to use it
  imports: [TriggerFloatingBoxForDirective, AnchoredFloatingBox],
  template: `
    <button
      id="click-me"
      [lcTriggerFloatingBoxFor]="floatingBoxTemplateRefVar"
      type="button">
      Click me
    </button>

    <lc-anchored-floating-box
      #floatingBoxTemplateRefVar
      class="test-example"
      theme="dark">
      Hello Angular!!!</span>
    </ng-template>
  `
})
class MyComponent {}

Result

  • Light theme Example 1, light theme

  • Dark theme Example 2, dark theme

It will also reposition itself if it overflows the top or bottom edge of the viewport like so. Example 3, auto-repositioning when overflowing the bottom Example 4, auto-repositioning when overflowing the top

Real world example

Below is a screenshot of a personal app of mine at https://memecomposer.com that uses this component. Clicking on the brush icon button popped open an anchored floating box, then clicking "Text appearance" button inside of it opened another anchored floating box that is independent of the previous one and any others.

Example 5, real world usage example