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/layout-wrapper

v5.0.1

Published

ECL layout wrapper

Readme

ECL Layout wrapper

npm package: @ecl/layout-wrapper

npm install --save @ecl/layout-wrapper

Parameters

  • "nb_columns" (int) (default: 3): Number of item columns (2, 3, or 4)
  • "forced_column" (boolean) (default: false): If true, columns on desktop will always be with a fixed number, instead of dynamically adapting to the container; use with caution
  • "info_position" (string) (default: 'top'): Position of the title/description block. Possible options:
    • top: always stacked above the grid
    • side: beside the grid at wider breakpoints; capped to 3 columns
  • "title" (object) (default: {}): Title of the layout wrapper
    • "level" (int) (default: 2): Heading level
    • "label" (string) (default: ''): Title content
  • "description" (string) (default: ''): Description of the layout wrapper
  • "items" (array) (default: []): Items to be displayed in the wrapper. Each item can be either:
    • a string (rendered as-is)
    • an object with a defining component key, e.g. { card: { ... } } Supported component keys: card, navigation_list, content_item, file, list_illustration
  • "direction" (string) (default: "horizontal"): Flow of items; can be "horizontal" or "vertical"
  • "view_all" (object) (default: {}): Link display below the grid; Follows the ECL Link structure
  • "full_height" (boolean) (default: true): Elements inside the layout wrapper would take the full height
  • "extra_classes" (string) (default: '')
  • "extra_attributes" (array) (default: []): format: [ { "name" (string) (default: ''), "value" (optional) (string) }, ... ],

Example:

{% include '@ecl/layout-wrapper/layout-wrapper.html.twig' with { 
  title: {
    level: 2,
    label: 'Heading',
  },
  description: 'Description',
  items: [
    card: {
      // Card content, following the component structure 
      ... 
    },
    navigation_list: { 
      // Navigation list content, following the component structure 
      ... 
    },
  ],
  view_all: {
    link: {
      path: '#',
      label: 'View all',
    },
  },
} %}

How it works

The layout wrapper uses CSS container queries to adapt its column count based on its own available width, not the viewport. This means it responds correctly whether placed full-width or inside a narrower context (e.g. a sidebar layout).

The outer .ecl-layout-wrapper element establishes the container context (container-type: inline-size). An inner .ecl-layout-wrapper__grid element holds the actual CSS grid and is styled by the container queries.

Column breakpoints (col-x variants):

| Container width | col-2 | col-3 | col-4 | | --------------- | ------- | ------- | ------- | | default | 1 col | 1 col | 1 col | | > m | 2 cols | 2 cols | 2 cols | | > l | — | 3 cols | 3 cols | | > xl | — | — | 4 cols |

Highlight variants (highlight-col-x) place a first item (typically a heading) to the left of a sub-grid of remaining items. At smaller sizes both sections stack vertically.

| Container width | highlight-col-2 | highlight-col-3 | | --------------- | -------------------------- | -------------------------- | | default | stacked | stacked | | > m | stacked, content 2 cols | stacked, content 2 cols | | > l | highlight | 2-col content | stacked, content 3 cols | | > xl | — | highlight | 3-col content |

Vertical flow (direction="vertical") fills items top-to-bottom within each column before moving to the next, instead of the default left-to-right order:

horizontal (default)     vertical
[ 1 ][ 2 ][ 3 ]          [ 1 ][ 3 ][ 5 ]
[ 4 ][ 5 ][ 6 ]          [ 2 ][ 4 ][ 6 ]

This is implemented with grid-auto-flow: column and an explicit grid-template-rows, which tells the browser how many rows to fill before wrapping to the next column. Below > m (single column), vertical flow has no effect and items stack normally.

Because the column count changes at each breakpoint, the required row count changes too — e.g. 6 items in 2 cols needs 3 rows, but in 3 cols needs 2 rows. CSS cannot compute this dynamically, so the template pre-calculates all needed values and outputs them as separate custom properties (--ecl-layout-rows-2, --ecl-layout-rows-3, --ecl-layout-rows-4). Each container query breakpoint then references the variable that matches its active column count.