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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nexora-ui/listbox-cdk

v0.1.2

Published

CDK virtual-scroll list panel used by **combobox** and **select** in built-in virtual mode. Registers with `NxrListboxVirtualScrollRegistry` so keyboard navigation targets the full logical list while the DOM stays windowed.

Downloads

629

Readme

@nexora-ui/listbox-cdk

CDK virtual-scroll list panel used by combobox and select in built-in virtual mode. Registers with NxrListboxVirtualScrollRegistry so keyboard navigation targets the full logical list while the DOM stays windowed.

Package layout

| Area | Path | Role | | ----------------------------- | --------------------- | --------------------------------------------------------------------------------------------- | | Public components | src/lib/components/ | ListboxCdkVirtualPanelComponent, built-in shell / dropdown, template directives | | Overlay flex tokens | src/lib/layout/ | Shared nxr-listbox-cdk-overlay-flex-column styles (pane + hosts need a definite flex chain) | | Portal | src/lib/portal/ | createListboxOverlayPanelPortal | | Stateless virtual helpers | src/lib/virtual/ | Selection index math, scroll alignment, LRU labels, first-paint scheduling |

Root entry (@nexora-ui/listbox-cdk): components + NXR_LISTBOX_CDK_OVERLAY_FLEX_COLUMN_CLASS for advanced styling.

Internal entry (@nexora-ui/listbox-cdk/internal): portal, signals factory, scroll/index utilities, afterVirtualPanelFirstPaint. See internal/README.md.

Peers: @nexora-ui/listbox, @angular/cdk, @nexora-ui/overlay (portal).

When you use this

  • Default: virtualScroll + virtualItems on <nxr-combobox> / <nxr-select> — they host nxr-builtin-virtual-dropdown-panel and wire overlay + listbox. Row/header/footer templates: nxrComboboxVirtual* / nxrSelectVirtual*.
  • Custom panel: embed nxr-listbox-cdk-virtual-panel only with NxrListboxOverlayPanelHostComponent’s injector (NXR_LISTBOX_CONTROLLER, NxrListboxVirtualScrollRegistry). Import the host/context symbols from @nexora-ui/listbox/internal, use childOwnsScroll: true, and:
    • viewportMaxHeight aligned with overlay maxHeight
    • fillAvailableHeight when the parent is a flex column under a capped pane
    • mergeVirtualDropdownPaneStyle + createListboxVirtualDropdownPanelStyle (from @nexora-ui/dropdown) on the pane so max-height alone does not collapse flex children to 0
    • Optional: reuse NXR_LISTBOX_CDK_OVERLAY_FLEX_COLUMN_CLASS on your hosts to match the built-in shell

Component inputs

| Input | Purpose | | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | items | Logical array (e.g. filtered options). | | itemSize | Row height in px (default 40). Must match rendered row CSS. | | initialSelectedIndex | When ≥ 0, scrolls after layout and sets active option. | | viewportMaxHeight | Viewport max-height (default 200px). With fillAvailableHeight, caps a flex-grown viewport. | | fillAvailableHeight | Host joins the overlay flex column; viewport fills remaining space in the shell. | | labelFor | Stable (item) => string reference preferred so the label LRU is not cleared every CD cycle. | | trackByKey | Stable key per row; built-in combobox/select default to accessors().value when virtualTrackByKey is omitted. Duplicate keys → first index wins. | | emptyMessage | Empty state copy (role="status", aria-live="polite"). | | optionTemplate | TemplateRef context { $implicit: item }; labelFor still used where the listbox needs text. |

Behavior notes

  • First paint: afterVirtualPanelFirstPaint runs checkViewportSize after afterNextRender and again on the next frame when syncing initial selection — portaled viewports often measure 0×0 on the first tick.
  • ResizeObserver on the viewport is coalesced to one checkViewportSize per animation frame (createRafThrottled from @nexora-ui/core).
  • getCurrentIndex uses a map from items + trackByKey (O(1) per lookup).
  • Labels: bounded LRU (512 entries); invalidates when items reference or labelFor identity changes.
  • “Nearest” scroll: uses overlap with the listbox found from viewport.parentElement.closest('[role="listbox"]') so header/footer chrome does not fake “fully visible” rows.

Installation

npm install @nexora-ui/listbox-cdk @nexora-ui/listbox @angular/cdk

Tests

nx test listbox-cdk