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

@ecl/site-header

v5.0.0-RC1

Published

ECL Site Header

Downloads

1,277

Readme

ECL Site Header component

npm package: @ecl/site-header

npm install --save @ecl/site-header

Parameters

  • "logged" (boolean) (default: false): Whether the user is logged in or not
  • "menu" (associative array): Menu content, if any. Uses ECL Menu structure
  • "banner_top" (string) OR (object with Link component in property): Class name
  • "site_name" (string) (default: '') Site name
  • "site_name_mobile_only" (boolean): Whether the site name should be hidden on desktop or not
  • "logo" (associative array) (default: predefined structure): Logo image settings. format:
    • "title" (string) (default: ''): Logo title attribute.
    • "alt" (string) (default: ''): Logo alt attribute.
    • "breakpoint": (string) (default: 's') Expected value in EU is "l"
    • "href" (string) (default: ''): Logo URL.
    • "src_desktop" (string) (default: ''): Desktop logo image file path
    • "src_mobile" (string) (default: ''): Mobile logo image file path for EU only
    • "size": (string) (default: 'l'): Three sizes in desktop (s, m, l)
  • "login_box" (associative array) format:
    • "id": (string) Id of the box
    • "description" (string) Label for the logged in users
    • "label" (string) Log out label
    • "href" (string) Url of the link
  • "login_toggle" (associative array) format:
    • "label_not_logged" (string) Label for the anonymous users
    • "href_not_logged" (string) Link to the login form
    • "label_logged" (string) Label for the logged in users
    • "href_logged" (string) Link to the logout form
  • "custom_action" (associative array) (default: {}):
    • "link" (object) (default: predefined structure) predefined structure for the Link component
    • "icon" (optional) (associative array) OR (array) of associate arrays - Default structure of the icon component, but extra_classes is an internal key. The name has to be non empty for the icon to be printed.
    • "overlay": (associative array) (optional):
      • "title": (string) (default: '') Overlay title
      • "close": (associative array) (default: {})
      • "content": (string) (default: '') HTML for the popover
  • "language_selector" (associative array) (default: predefined structure): Language switcher settings. format:
    • "href" (string) (default: ''): URL for switcher
    • "label" (string) (default: ''): Switcher language label, eg. 'English' in eu, 'EN' in ec
    • "aria_label" (string) (default: ''): Switcher language aria label
    • "eu_category" (string) (default: ''): Label for EU languages
    • "non_eu_category" (string) (default: ''): Label for non-EU languages
    • "overlay" (associative array) (default: predefined structure): Overlay language switcher settings. format:
      • "close": (associative array) (default: {}): Close button, following ECL Button structure
      • "title" (string) (default: ''): Overlay title, eg. 'Select your language'.
      • "items" (array) (default: []): (array) (default: []): format:
        • "lang" (string) (default: '') Item language code, eg. 'en', 'fr', etc.
        • "label" (string) (default: '') Item language label, eg. 'English', 'Français', etc.
        • "path" (string) (default: '') Item language URL eg. '/example#language_en'.
        • "active" (boolean) (default: false) define if item is the active language.
      • "non_eu_items" (array) (default: []): (array) (default: []): format:
        • "lang" (string) (default: '') Item language code, eg. 'en', 'fr', etc.
        • "label" (string) (default: '') Item language label, eg. 'English', 'Français', etc.
        • "path" (string) (default: '') Item language URL eg. '/example#language_en'.
        • "active" (boolean) (default: false) define if item is the active language.
  • "search_toggle" (associative array) format:
    • "label" (string) Label of the element
    • "href" (string) Link of the element
  • "search_form" (associative array) (default: predefined structure): ECL Search Form component structure
  • "notification" (object) (default: {}): Optional notification compatible with ECL Notification component structure
  • "extra_classes" (optional) (string) (default: '') Extra classes (space separated)
  • "extra_attributes" (optional) (array) (default: []) Extra attributes
    • "name" (string) Attribute name, eg. 'data-test'
    • "value" (string) Attribute value, eg: 'data-test-1'

Example :

{% include '@ecl/site-header/site-header.html.twig' with { 
  banner_top: 'Class name', 
  site_name: 'This site name'
  logo: {
    alt: 'European Commission', 
    href: '/example', 
    src: '/logo-ec--en.svg', 
  }, 
  language_selector: { 
    href: '/example', 
    label: 'English', 
    aria_label: 'Change language',
    code: 'en', 
    overlay: { 
      close_label: 'Close', 
      title: 'Select your language', 
      items: [ 
        { lang: 'bg', label: 'български', path: '/example#language_bg' }, 
        { lang: 'es', label: 'español', path: '/example#language_es', active: true }, 
        ... 
      ], 
    }, 
  },
  custom_action: { 
    href: '/notifications', 
    icon: 'bell', 
    label: 'Notifications', 
    aria_label: 'View notifications', 
    indicator: true, 
    overlay: { 
      title: 'Notifications', 
      close: { 
        label: 'Close' 
      }, 
      content: '<p>You have new notifications.</p>', 
    }, 
  }, 
  login_toggle: { 
    label_not_logged: 'Log in', 
    href_not_logged: '/example', 
    label_logged: 'Logged in', 
    href_logged: '/example', 
  }, 
  login_box: { 
    id: 'login-box-id', 
    description: 'Logged in as <last name>, <first name>', 
    label: 'Log out', 
    href: '/example', 
  }, 
  search_toggle: { 
    label: 'Search', 
    href: '#', 
  }, 
  search_form: { 
    text_input: { 
      id: 'input-search', 
      name: 'search', 
    }, 
    button: { 
      label: 'Search', 
    }, 
  }, 
  extra_classes: 'my-extra-class-1 my-extra-class-2', 
  extra_attributes: [ 
    { name: 'data-test', value: 'data-test-value' }, 
    { name: 'data-test-1', value: 'data-test-value-1' }, 
    ... 
  ], 
} %}