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

@entur-partner/sidebar

v1.6.0-alpha.0

Published

Sidebar component for Entur Partner applications with navigation, user menu, organisation selector, and environment switching.

Readme

@entur-partner/sidebar

Sidebar component for Entur Partner applications with navigation, user menu, organisation selector, and environment switching.

Installation

npm install @entur-partner/sidebar

Styles

Import the sidebar styles alongside any @entur/* styles your app needs:

@import '@entur-partner/sidebar/styles';

Usage

Use EnturPartnerSidebarLayout for the standard Entur Partner look with built-in user menu items (language toggle, version, profile, cookie settings, logout) and the full page layout. Pass your router's link component so navigation works with your SPA, and place your page content as children:

import { EnturPartnerSidebarLayout } from '@entur-partner/sidebar';
import { Link, useNavigate } from 'react-router';

function App() {
  const navigate = useNavigate();

  return (
    <EnturPartnerSidebarLayout
      user={{
        email: '[email protected]',
        givenName: 'Jan',
        familyName: 'Johansen',
        isEnturUser: true,
      }}
      organisations={[
        { organisationId: 1, tradingName: 'Entur' },
      ]}
      links={[
        {
          label: { 'nb-NO': 'Hjem', 'en-GB': 'Home' },
          path: '/',
          iconName: 'MapIcon',
        },
      ]}
      linkComponent={Link}
      navigate={(to) => navigate(to)}
    >
      <main>
        <h1>Entur Partner</h1>
      </main>
    </EnturPartnerSidebarLayout>
  );
}

EnturPartnerSidebarLayout props

| Prop | Type | Required | Description | |---|---|---|---| | linkComponent | SidebarLinkComponent | Yes | Your router's link component (e.g. React Router's Link). Must accept to, children, className, and onClick props. | | navigate | (to: string) => void | Yes | Called when user menu items need to navigate (e.g. "My profile", "Version"). Should call history.pushState or your router's navigate function. | | user | SidebarUser | No | Current user info. When isEnturUser is true, the environment selector and organisation picker are shown. | | organisations | SidebarOrganisation[] | No | Organisations the user can switch between. Only visible for Entur users. | | links | SidebarLink[] | No | Navigation links shown in the sidebar. | | subItemsPerPath | Record<string, SidebarSubMenuItem[]> | No | Sub-menu items keyed by parent link path. |

Sidebar (base component)

If you need full control over the logo, environment URLs, user menu items, or locale, use the base Sidebar component instead:

| Prop | Type | Required | Description | |---|---|---|---| | environment | Environment | Yes | "local", "development", "staging", or "production". | | environmentUrls | { devUrl: string; stagingUrl: string; prodUrl: string } | Yes | URLs for each environment (used by the environment selector). | | linkComponent | SidebarLinkComponent | Yes | Your router's link component. | | locale | SidebarLocale | Yes | "nb-NO" or "en-GB". | | logoComponent | React.ReactNode | Yes | Logo rendered at the top of the sidebar. | | onOrganisationChange | (organisationId: number) => void | Yes | Called when the user switches organisation. | | organisationId | number \| undefined | Yes | Currently selected organisation ID. | | userMenuItems | SidebarUserMenuItem[] | Yes | Items shown in the user menu dropdown. Each item has label, icon, and onClick. | | subItemsPerPath | Record<string, SidebarSubMenuItem[]> | Yes | Sub-menu items keyed by parent link path. | | user | SidebarUser | No | Current user info. | | organisations | SidebarOrganisation[] | No | Organisations the user can switch between. | | links | SidebarLink[] | No | Navigation links. |

Exports

| Export | Kind | Description | |---|---|---| | EnturPartnerSidebarLayout | Component | Pre-configured sidebar with layout wrapper. Includes the full page layout so consumers don't need @entur/layout/beta directly. | | Sidebar | Component | Base sidebar component for custom configurations. | | SidebarUser | Type | User object shape. | | SidebarOrganisation | Type | Organisation object shape. | | SidebarLink | Type | Navigation link shape. | | SidebarSubMenuItem | Type | Sub-menu item shape (React version, includes navigate). | | SidebarLinkComponent | Type | React component type for the linkComponent prop. | | SidebarLinkComponentProps | Type | Props that linkComponent must accept (to, children, className, onClick). | | SidebarLocale | Type | "nb-NO" \| "en-GB". | | SidebarIconName | Type | Union of allowed icon names. |

CDN usage (no build step)

The package also ships a self-contained IIFE bundle that registers an <entur-partner-layout> custom element. It includes both the sidebar and a layout wrapper with a <slot> for your main content. Load it with a single <script> tag — no framework or build step required. It renders inside a Shadow DOM so its styles are fully encapsulated.

1. Add the script and element

<entur-partner-layout>
  <main>
    <h1>My page content</h1>
  </main>
</entur-partner-layout>

<script src="https://your-cdn.example.com/entur-partner-layout.js"></script>
<script>
  const layout = document.querySelector("entur-partner-layout");

  layout.configure({
    user: {
      email: "[email protected]",
      givenName: "Jan",
      familyName: "Johansen",
      isEnturUser: true,
    },
    organisations: [
      { organisationId: 111, tradingName: "Connect Bus Sørlandsruta" },
      { organisationId: 222, tradingName: "Børselv Taxi" },
    ],
    links: [
      {
        label: { "nb-NO": "Avtaletjenesten", "en-GB": "Agreement Service" },
        iconName: "FeedbackIcon",
        path: "/agreement-service",
      },
      {
        label: { "nb-NO": "Innsikt", "en-GB": "Insights" },
        iconName: "ChartIcon",
        path: "/data-dashboards",
      },
    ],
    onNavigate: (path) => console.log("Navigate to", path),
  });
</script>

The element renders inside a Shadow DOM, so its styles won't leak into or be affected by your page. Child content is projected into the layout's main area via <slot>.

2. Update at runtime

Call configure() again at any time to re-render with new config:

layout.configure({
  links: [/* updated links */],
});

CDN configuration reference

| Property | Type | Description | |---|---|---| | user | SidebarUser | Current user info. | | organisations | SidebarOrganisation[] | Organisations the user can switch between. | | links | SidebarLink[] | Navigation links shown in the sidebar. | | subItemsPerPath | Record<string, CdnSidebarSubMenuItem[]> | Sub-menu items keyed by parent link path. | | onNavigate | (path: string) => void | Called when a link is clicked (for SPA routing). |

CDN sub-menu items differ from the React version. They omit the navigate function since the element handles routing via onNavigate:

type CdnSidebarSubMenuItem = {
  title: string;
  to: string;
  disabled?: boolean;
};

License

EUPL-1.2