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

@bitstack/ng-boundary

v14.0.6-alpha.6

Published

A responsive boundary component for Angular applications with built-in orientation support and SCSS utilities for pixel-perfect responsive design.

Readme

@bitstack/ng-boundary

A responsive boundary component for Angular applications with built-in orientation support and SCSS utilities for pixel-perfect responsive design.

Features

  • Responsive boundary container with automatic aspect ratio management
  • Portrait and landscape orientation support with auto-detection
  • CSS custom properties for responsive sizing
  • Comprehensive SCSS utilities for responsive design
  • Standalone component architecture (Angular 14+)

Installation

npm install @bitstack/ng-boundary

Usage

1. Using the Component

Import and use the BsBoundary component in your Angular application:

import { Component } from '@angular/core';
import { BsBoundary } from '@bitstack/ng-boundary';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [BsBoundary],
  template: `
    <bs-boundary
      [isDebug]="false"
      [bgColor]="'transparent'"
      [contentClickable]="true"
      [orientationMode]="'auto'"
      (afterBoundaryInit)="onBoundaryInit($event)"
      (orientationChange)="onOrientationChange($event)">
      <!-- Your content here -->
      <div class="my-content">
        Hello World
      </div>
    </bs-boundary>
  `
})
export class AppComponent {
  onBoundaryInit(boundary: ElementRef<HTMLDivElement>) {
    console.log('Boundary initialized:', boundary);
  }

  onOrientationChange(mode: 'portrait' | 'landscape') {
    console.log('Orientation changed to:', mode);
  }
}

Component Inputs

  • isDebug: (boolean) Enable debug mode with background color - default: false
  • bgColor: (string) Background color for the boundary
  • contentClickable: (boolean) Whether content is clickable - default: true
  • orientationMode: ('auto' | 'portrait' | 'landscape') Orientation mode - default: 'auto'
  • injectStyle: (IInjectStyle) Custom styles to inject

Component Outputs

  • afterBoundaryInit: Emits after boundary initialization with ElementRef
  • orientationChange: Emits when orientation changes

2. Using SCSS Utilities

The boundary component provides CSS custom properties that you can use with the included SCSS utilities:

Import SCSS Utilities

In your component SCSS file or global styles:

@use '@bitstack/ng-boundary/styles' as boundary;

.my-component {
  // Use the px2vw function for responsive sizing
  // This automatically adapts to portrait/landscape mode
  width: boundary.px2vw(100);
  height: boundary.px2vw(200);
  padding: boundary.px2vw(20);

  // Or use mixins for specific properties
  @include boundary.width(100);
  @include boundary.height(200);
  @include boundary.padding-left(20);
}

Available SCSS Functions

  • px2vw($px) - Converts px to responsive units based on boundary
  • px2vw-unbounded($px) - Converts px to viewport units (not bounded)
  • vw($w) - Returns viewport width unit (dvw or vw)
  • vh($h) - Returns viewport height unit (dvh or vh)

Available SCSS Mixins

Responsive sizing mixins:

  • @include width($px) - Set responsive width
  • @include height($px) - Set responsive height
  • @include padding-left($px) - Set responsive left padding
  • @include padding-right($px) - Set responsive right padding
  • @include padding-top($px) - Set responsive top padding
  • @include padding-bottom($px) - Set responsive bottom padding
  • @include px2vw($property, $px) - Set any property with responsive value

Utility mixins:

  • @include flexCenter - Flex center alignment
  • @include hideScrollbar - Hide scrollbars
  • @include bg-contain - Background contain
  • @include bg-cover - Background cover
  • @include text-center - Center text
  • @include text-shadow($color) - Text shadow
  • @include size($w, $h: $w) - Set width and height

Responsive breakpoint mixins:

  • @include s { ... } - Small devices and up
  • @include landscape { ... } - Mobile landscape
  • @include portrait { ... } - Mobile portrait
  • @include pc_landscape { ... } - PC landscape
  • @include pc_portrait { ... } - PC portrait

CSS Custom Properties

The boundary component sets these CSS variables that the SCSS utilities use:

  • --boundary-width - Current boundary width
  • --boundary-height - Current boundary height
  • --design-base-width - Design base width (portrait: 540, landscape: 960)
  • --design-base-height - Design base height (portrait: 960, landscape: 540)
  • --px2vw-ratio - Ratio for px to responsive unit conversion

3. Complete Example

// app.component.ts
import { Component } from '@angular/core';
import { BsBoundary } from '@bitstack/ng-boundary';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [BsBoundary],
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {}
<!-- app.component.html -->
<bs-boundary [orientationMode]="'auto'">
  <div class="game-container">
    <h1 class="title">My Game</h1>
    <button class="play-button">Play</button>
  </div>
</bs-boundary>
// app.component.scss
@use '@bitstack/ng-boundary/styles' as boundary;

.game-container {
  @include boundary.flexCenter;
  flex-direction: column;
  width: 100%;
  height: 100%;
  gap: boundary.px2vw(20);
}

.title {
  font-size: boundary.px2vw(48);
  @include boundary.padding-top(40);
}

.play-button {
  @include boundary.width(200);
  @include boundary.height(60);
  font-size: boundary.px2vw(24);
  border-radius: boundary.px2vw(12);
}

Design System

The component is designed with these base dimensions:

  • Portrait mode: 540px × 960px
  • Landscape mode: 960px × 540px

The px2vw() function automatically scales your design to fit within the boundary while maintaining aspect ratio.

Requirements

  • Angular 14.0.0 or higher
  • @angular/cdk 14.0.0 or higher
  • SCSS support in your Angular project

Building

To build the library:

ng build bitstack-ng-boundary

License

MIT