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

@dawit-io/spartan-sidebar-core

v0.0.6

Published

Angular sidebar component library - brain implementation

Readme

@dawit-io/spartan-sidebar-core

Headless, unstyled Angular sidebar primitives with signal-based state management. Part of the Spartan Dashboard project.

Installation

npm install @dawit-io/spartan-sidebar-core

Quick Start

import { BrnSidebarComponent, BrnSidebarTriggerDirective } from '@dawit-io/spartan-sidebar-core';

@Component({
  selector: 'app-layout',
  standalone: true,
  imports: [BrnSidebarComponent, BrnSidebarTriggerDirective],
  template: `
    <div class="flex">
      <brn-sidebar [variant]="'sidebar'" [collapsibleMode]="'icon'">
        <!-- sidebar content -->
      </brn-sidebar>
      <div>
        <button brnSidebarTrigger>Toggle</button>
        <!-- main content -->
      </div>
    </div>
  `,
})
export class LayoutComponent {}

Components & Directives

| Export | Selector | Description | |--------|----------|-------------| | BrnSidebarComponent | brn-sidebar | Root sidebar container. Provides BrnSidebarService to children. | | BrnSidebarTriggerDirective | [brnSidebarTrigger] | Toggle directive. Apply to any button to expand/collapse the sidebar. | | BrnSidebarGroupDirective | [brnSidebarGroup] | Collapsible group container with toggleExpansion() method. | | BrnSidebarGroupLabelDirective | [brnSidebarGroupLabel] | Label for a group. Auto-generates ID for ARIA aria-labelledby. | | BrnSidebarNavDirective | [brnSidebarNav] | Navigation container with role="navigation". | | BrnSidebarNavItemDirective | [brnSidebarNavItem] | Navigation item. Inputs: icon, isActive. Sets aria-current="page" when active. | | BrnSidebarFooterComponent | brn-sidebar-footer | Footer slot at the bottom of the sidebar. |

BrnSidebarComponent Inputs

| Input | Type | Default | Description | |-------|------|---------|-------------| | isCollapsible | boolean | true | Whether the sidebar can be collapsed | | isOverlay | boolean | false | Whether the sidebar overlays the content | | variant | SidebarVariant | 'sidebar' | Layout variant | | collapsibleMode | CollapsibleMode | 'icon' | Collapse behavior |

BrnSidebarService

Injected automatically by BrnSidebarComponent. Access it in child components via inject(BrnSidebarService).

Signals (read-only)

| Signal | Type | Description | |--------|------|-------------| | id | string | Auto-generated sidebar ID | | isExpanded | boolean | Current expansion state | | isCollapsible | boolean | Whether sidebar can collapse | | isMobile | boolean | true when viewport <= 768px | | isOverlay | boolean | Whether overlay mode is active | | variant | SidebarVariant | Current variant | | collapsibleMode | CollapsibleMode | Current collapsible mode |

Methods

| Method | Description | |--------|-------------| | toggle() | Toggle expanded/collapsed state (no-op if isCollapsible is false) | | setVariant(variant) | Change the layout variant | | setCollapsibleMode(mode) | Change the collapsible mode | | setMobileState(isMobile) | Set mobile state (auto-switches to offcanvas + overlay on mobile) | | setOverlayMode(isOverlay) | Set overlay mode | | setCollapsible(isCollapsible) | Set whether sidebar is collapsible |

Types

type SidebarVariant = 'sidebar' | 'floating' | 'inset';
type CollapsibleMode = 'offcanvas' | 'icon' | 'none';

Variants

  • sidebar -- Standard fixed sidebar, sticky to the left
  • floating -- Absolute positioned with shadow, overlays content
  • inset -- Bordered card-style sidebar with margins

Collapsible Modes

  • icon -- Collapses to a narrow icon-only bar
  • offcanvas -- Slides in/out from the left with transform animation
  • none -- Always visible, no collapse behavior

Mobile Behavior

The service auto-detects viewports <= 768px and switches to offcanvas mode with overlay enabled. The sidebar is closed by default on mobile.

Import Options

Standalone (recommended):

import { BrnSidebarComponent, BrnSidebarTriggerDirective } from '@dawit-io/spartan-sidebar-core';

@Component({
  imports: [BrnSidebarComponent, BrnSidebarTriggerDirective],
})

Convenience array:

import { BrnSidebarImports } from '@dawit-io/spartan-sidebar-core';

@Component({
  imports: [...BrnSidebarImports],
})

NgModule:

import { BrnSidebarModule } from '@dawit-io/spartan-sidebar-core';

@NgModule({
  imports: [BrnSidebarModule],
})

Styled Version

For pre-styled components with Tailwind CSS, use @dawit-io/spartan-sidebar.

Live Demo

spartan-dashboard.gojodigital.com

License

MIT