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

themable-grid

v2.0.1

Published

> This is a work in progress experimental lovelace grid card replacement.

Downloads

2

Readme

Lovelace themable grid WIP

This is a work in progress experimental lovelace grid card replacement.

A responsive grid card that can be defined once per lovelace dashboard

Demo

Installation

Try HACS first

  1. Download the themable-grid.js from the latest release and store it in your configuration/www folder.
  2. Configure Lovelace to load the card:

Configuration

The cards key to list cards is required and the only needed config. You can configure the grid styling and breakpoints in your root lovelace config (recommended) or on the individual themable-grid card. You can either rely on the built-in breakpoints to get a 1-2-3 column setup for mobile-tablet-desktop or you can override with your own breakpoints. The default breakpoints will be named mobile, tablet and desktop to make the intention very clear. These names can be used to override styles for the individual cards on individual breakpoints.

type: 'custom:themable-grid'
cards:
  - type: markdown
    content: First
  - type: markdown
    content: Second
  - type: markdown
    content: Third

Define the configuration for the card in your root lovelace config as in this example. You can use an arbitrary number of breakpoints. This config shows the defaults if you don't supply a config.

themable_grid:
  padding: 0
  gap: 8px
  breakpoints:
    - name: mobile
      mq: (max-width: 767px)
      columns: 1
    - name: tablet
      mq: (min-width: 768px) and (max-width: 1023px)
      columns: 2
    - name: desktop
      mq: (min-width: 1024px)
      columns: 3

Tweaking specific cards

You can style specific cards in order to for example have it span all columns or to enforce it to start in a new row – or any other crazy thing you want to. These styles are currently applied to the wrapper div for the card. In the future the wrapping div might go away and styling be applied to the actual card custom element. Style overrides are set on the grid prop, which accepts any CSS property with either a value for all breakpoints or specific values for specific breakpoints. Here are some examples

Card spans all columns

type: 'custom:themable-grid'
cards:
  - type: markdown
    content: First
  - type: markdown
    content: Second
    grid:
      grid-column: 1 / -1

Force card to start a new row on desktop

type: 'custom:themable-grid'
cards:
  - type: markdown
    content: First
  - type: markdown
    content: Second
    grid:
      grid-column:
        desktop: 1

Caveats

  1. Part of what makes this experimental is that it is built using Svelte, because I wanted to test it out.
  2. All the cards will be wrapped in a div because I've yet to find a working way to avoid that for dynamic tag names in Svelte.
  3. It probably breaks in a number of cases
  4. It requires a modern browser

Roadmap/ideas

  • [x] Arbitrary number of breakpoints. Perhaps 2 breakpoints are enough for some yet 4 is better for other.
  • [ ] Get rid of the wrapping div
  • [ ] UI editor. Can probably be based on the native grid one