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

glamrock-agenda

v0.0.22

Published

Glamrock agenda

Readme

The Eagerly agenda, built for Glamrock

For local testing

cd your-lib-folder/

npm link

cd your-app/

npm link name-of-your-lib

Want to also minify bundle output?

You can install rollup-plugin-terser (still works with rollup v3, but since it has no updates, we need to install it with legacy peer options)

npm i rollup-plugin-terser --save-dev --legacy-peer-deps

The Agenda component allows for flexible rendering of the following components:

  • Tile
  • Image
  • Link
  • NotFound
  • LoadMoreButton This is useful when you want to overwrite a default component with different markup or styling.

Props

The Agenda component accepts the following props:

| Prop Name | Type | Required | Description | | ------------------------ | ------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | data | Array | Yes | An array of events and promo texts to render in the agenda. Each item should follow the structure expected by the agenda. | | helperText | ReactNode or string | No | Optional text strings to overwrite default strings that can be found in strings.ts. | | searchParams | Record<string, unknown> | No | An object containing key-value pairs for filtering, pagination, and other query parameters. Useful for server-side filtering or client-side control. | | handleParamsChange | (params: Record<string, unknown>) => void | No | A callback function triggered when the searchParams are updated by user actions or internal state changes. | | filters | Array or Record<string, unknown> | No | Configures the filter options available for users to refine the displayed data. | | options | Object | No | A collection of configuration options for customizing agenda behavior. See Options Table for details. | | components | Object | No | Custom React components to override default UI elements. See Components Table for details. |

Example helperText

...
helperText={{
  loadMore: 'Show me more please!',
}}
...

Options

| Prop | Type | Default | Description | | ----------------------- | ---------------------------------------------- | -------------------------------------------------- | ---------------------------------------------------------------- | | locale | string | 'nl-NL' | Sets the locale for date formatting. | | postsPerPage | number | 5 | Number of posts to display per page. | | showViewSwitcher | boolean | false | Enables the view switcher functionality. | | showTotal | boolean | true | Optionally show a total count above results | | useOverlay | boolean | true | Whether to show the filters in an overlay or not | | promoFrequency | number | 4 | Frequency at which promo strips are shown. | | promoStrips | ReactNode[] | [] | Array of custom promo strips to display. | | date.formatSingle | string | 'EEE d MMM yyyy' | Date format for single dates. | | date.formatRange | {start: string, end: string} | {start: 'EEE d MMM yyyy', end: 'EEE d MMM yyyy'} | Date format for range of dates. | | date.dateRangeDivider | string | '->' | Divider used in date ranges. | | date.useMostRecent | boolean | false | Uses the most recent date if multiple are available. | | groupEventsByMonth | boolean | true | Groups events by month in the agenda view. | | loadMore | function | undefined | Callback function triggered when loading more events. | | icons | { prevPage: ReactNode, nextPage: ReactNode } | {} | Object containing custom icon components for navigation buttons. | | filters | any[] | [] | Array of filter options for the agenda. | | searchParams | object | {} | Search parameters for filtering agenda items. | | handleParamsChange | function | undefined | Callback function triggered when search parameters change. |

Example custom options

const promoStrips = [
  <div key={1} style={{ background: 'green' }}>
    Promo 1
  </div>,
  <div key={2} style={{ background: 'blue' }}>
    Promo 2
  </div>
];

Components

| Prop | Type | Default | Description | | --------------------------- | ---------------------------------------------- | ----------- | ---------------------------------------------------------------- | | components.Image | React.Component | Next Image | Custom image component for rendering images. | | components.Link | React.Component | Next Link | Custom link component for handling navigation. | | components.Tile | function | undefined | Custom tile renderer for agenda items. | | components.NotFound | ReactNode | undefined | Custom component to display when no items are found. | | components.LoadMoreButton | ReactNode | undefined | Custom button for loading more items. | | icons | { prevPage: ReactNode, nextPage: ReactNode } | {} | Object containing custom icon components for navigation buttons. | | filters | any[] | [] | Array of filter options for the agenda. | | searchParams | object | {} | Search parameters for filtering agenda items. | | handleParamsChange | function | undefined | Callback function triggered when search parameters change. |

Example custom components

The following components do not have a custom value in settings.js file of your Glamrock project. Here's how you can overwrite them:

Tile: ({ item }) => (
  <div key={item.title} className="custom-tile">
    <h3>{item.title}</h3>
  </div>
);
NotFound: <div>No items found</div>,
icons: {
  prevPage: <Icon icon="ARROW_RIGHT" fill="secondary" width="15px" height="15px" />,
  nextPage: <Icon icon="ARROW_RIGHT" fill="secondary" width="15px" height="15px" />
}
LoadMoreButton: <button>Load more</button>;

Full example

Here’s an example demonstrating how to implement a custom tile and custom promo strips. To use a custom tile rendering function, follow these steps:

  1. Define a custom rendering function that accepts a DataItem and returns the desired JSX markup.
  2. Overwrite the default Tile by passing this function to the Agenda component via the Tile prop:
'use client';

import Agenda from 'glamrock-agenda';
import AgendaStyled from './style'; // wrapper that contains all the styling
import useEvents from './useEvents'; // hook to prepare data
import { defaultOptions, defaultComponents } from './settings'; // default settings

const EagerlyAgenda = () => {
  const postsPerPage = defaultOptions.postsPerPage;
  const useLoadMore = defaultOptions.useLoadMore;

  const { currentParams, data, filters, handleParamsChange, loadMore } = useEvents({
    postsPerPage,
    useLoadMore,
  });

  // extend default options
  const customOptions = {
    ...defaultOptions,
    loadMore,
    // overwrite default value
    promoFrequency: 2,
    // overwrite default promo strips
    promoStrips: [
      <div key={1} style={{ background: 'green' }}>
        Promo 1
      </div>,
      <div key={2} style={{ background: 'blue' }}>
        Promo 2
      </div>,
    ],
  };

  // extend default components
  const customComponents = {
    ...defaultComponents,
    // add custom Tile
    Tile: (item) => (
      <div key={item.title} className="custom-tile">
        <h4 style={{ color: 'blue' }}>{item.title}</h4>
        <a href={item.link}>Read more</a>
      </div>
    ),
  };

  return (
    <AgendaStyled>
      <Agenda
        data={data}
        helperText={}
        searchParams={currentParams}
        handleParamsChange={handleParamsChange}
        filters={filters}
        options={customOptions}
        components={customComponents}
      />
    </AgendaStyled>
  );
};

export default EagerlyAgenda;

Build & Publish

You can use this template and change the name under package.json.

Build

npm run build

Build & Watch

npm run build:watch

Publish (public library)

Be sure you are either logged in under npm login or you have a token (check https://docs.npmjs.com/creating-and-viewing-access-tokens).

npm run publish --access=public