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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ecl/twig-component-gallery

v4.2.0

Published

ECL Gallery

Downloads

609

Readme

ECL Gallery

npm package: @ecl/twig-component-gallery

npm install --save @ecl/twig-component-gallery

Parameters

  • "id": (string) (default: random): Unique id for the gallery
  • "overlay" (object) (default: {})
    • "close" (object) (default: {}): object of type button
    • "previous" (object) (default: {}): object of type button
    • "next" (object) (default: {}): object of type button
    • "counter_separator" (string) (default: '')
    • "full_screen_label" (string) (default: '')
    • "download" (object) (default: {}): object of type link
    • "share" (object) (default: {}): object of type link
  • "items" (array) (default: [])
    • "title" (string) (default: '')
    • "description" (string) (default: '')
    • "meta" (string) (default: '')
    • "icon" (object) (default: {}): object of type icon
    • "picture" (optional) (object) (default: {}) object of type picture
    • "video" (optional) (object) (default: {})
    • "embedded_video" (optional) (object) (default: {})
    • "share_path" (optional) (string) (default: '')
  • "visible_items" (integer) (default: 8) Number of visible items in an expandable gallery
  • "expandable" (boolean) (default: true) collapsible/expandable gallery
  • "icon_path" (string) (default: '') Path to the icon sprite
  • "sr_video_label" (string) (default: ''): additional label for the video items; for screen readers
  • "sr_video_player" (string) (default: ''): additional label for the video player; for screen readers
  • "footer" (object) (default: {}) Footer link
  • "view_all_label" (string) (default: '') Label of the view all button
  • "view_all_expanded_label" (string) (default: '') Label when the gallery is expanded
  • "counter_label" (string) (default: '') Label of the counter
  • "disable_overlay" (boolean) (default: false) Disables the overlay functionality
  • "full_width" (boolean) (default: false) Full width gallery for desktop and tablet viewports
  • "selected_item_id" (int) (default: 0)
  • "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/gallery/gallery.html.twig' with {  
  id: 'my-gallery',
  view_all_label: 'View all', 
  counter_label: 'Media files in this gallery' , 
  visible_items: 6,
  disable_overlay: false,
  sr_video_label: 'Video',
  sr_video_player: 'Video player',
  items: [ 
    { 
      picture: {
        img: {
          src: 'path/to/image.jpg', 
          alt: 'Image 1',
        },
      }, 
      title: 'The EU in brief',
      description: 
        'The EU in brief, institutions and bodies, countries, symbols, history, facts and figures', 
      meta: 'Copyright, Author, Licence for image 1', 
      share_href: '/share#example-image.jpg', 
    }, 
    { 
      picture: {
        img: {
          src: 'path/to/image2.jpg', 
          alt: 'Image 2',
        },
      }, 
      title: 'Living in the EU',
      description: 'Living, working, travelling in the EU', 
      meta: 'Copyright, Author, Licence for image 2', 
      icon: { 
        path: 'path/to/icons.svg', 
        name: 'audio', 
      }, 
      share_href: '/share#example-image2.jpg', 
    }, 
    ... 
  ], 
  footer: { 
    link: { 
      label: "Link to further media items", 
      path: "/example", 
      aria_label: "View all link aria-label value" 
    }, 
    icon: { 
      path: "/icons.svg", 
      name: "external", 
      size: "s" 
    } 
  },
  overlay: { 
    close: { 
      variant: 'ghost', 
      label: 'Close', 
      icon: { 
        path: 'path/to/icons.svg', 
        name: 'close', 
        size: 's', 
      }, 
    }, 
    previous: { 
      variant: 'ghost', 
      label: 'Previous', 
      icon: { 
        path: 'path/to/icons.svg', 
        name: 'corner-arrow', 
        transform: 'rotate-270', 
        size: 'l', 
      }, 
      icon_position: 'before', 
    }, 
    next: { 
      variant: 'ghost', 
      label: 'Next', 
      icon: { 
        path: 'path/to/icons.svg', 
        name: 'corner-arrow', 
        transform: 'rotate-90', 
        size: 'l', 
      }, 
    }, 
    counter_separator: 'of', 
    full_screen_label: 'View original',
    share: { 
      label: 'Share', 
      icon: { 
        path: 'path/to/icons.svg', 
        name: 'share', 
        size: 'fluid', 
      }, 
    }, 
  }, 
} %}