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

@greenborn/vue-side-menu

v1.1.2

Published

Menú lateral genérico y autocontenido para Vue 3: configurable por props, responsive con overlay en móvil, filtrado opcional por permisos vía provide/inject y soporte opcional de vue-router. Sin dependencias de UI (CSS propio).

Readme

@greenborn/vue-side-menu

Menú lateral genérico y autocontenido para Vue 3. Configurable íntegramente por props, sin dependencias de UI (CSS propio), con comportamiento responsive (overlay en móvil), filtrado opcional por permisos vía provide/inject y soporte opcional de vue-router.

Extraído y genericizado a partir del sidebar de la aplicación SGI.

Instalación

npm install @greenborn/vue-side-menu

Uso básico

<template>
  <SideMenu
    :items="items"
    :visible="sidebarVisible"
    title="Menú"
    @close="sidebarVisible = false"
  />
</template>

<script>
import { provide } from 'vue'
import SideMenu, { HAS_PERMISSION_KEY } from '@greenborn/vue-side-menu'
import '@greenborn/vue-side-menu/style.css'

export default {
  components: { SideMenu },
  data() {
    return { sidebarVisible: false }
  },
  computed: {
    items() {
      return [
        { label: 'Dashboard', to: '/', icon: 'bi bi-speedometer2' },
        { label: 'Clientes', to: '/clientes', permiso: 'clientes.ver' },
        { label: 'Proyectos', href: '/proyectos' },
        { divider: true },
        {
          label: 'Instalar',
          icon: 'bi bi-download',
          action: () => this.installPwa(),
        },
      ]
    },
  },
  setup() {
    provide(HAS_PERMISSION_KEY, (permiso) => permisosUsuario.includes(permiso))
  },
}
</script>

Props

| Prop | Tipo | Default | Descripción | |------|------|---------|-------------| | items | Array | [] | Items del menú (ver esquema abajo). | | visible | Boolean | false | Controla el estado abierto/cerrado. | | breakpoint | Number | 768 | Ancho (px) bajo el cual se muestra el overlay móvil. | | title | String | 'Menú' | Texto del encabezado. | | footer | String | '' | Texto del pie (p. ej. versión). |

Esquema de un item

| Campo | Tipo | Descripción | |-------|------|-------------| | label | String | Texto visible. | | to | String/Object | Ruta para router-link (si vue-router está instalado; si no, se renderiza <a href>). | | href | String | Enlace plano <a href>. | | icon | String | Clase(s) del icono, renderizadas en un <i>. | | permiso | String | Clave de permiso. El item se muestra solo si hasPermission(permiso) es verdadero. | | divider | Boolean | Renderiza un separador. | | action | Function | Función ejecutada al hacer clic (usar cuando no hay to ni href). | | children | Array | Sub-items. Anidamiento recursivo de N niveles; si está presente, el item se renderiza como submenú desplegable. |

Emits

  • close — se emite al hacer clic en un item en modo móvil o al hacer clic en el overlay.

Slots

  • footer — contenido del pie del menú (genérico para versión/estado PWA, etc.).

Permisos

Si la aplicación llama a provide(HAS_PERMISSION_KEY, fn) con una función (permiso) => boolean, los items con permiso se filtran en consecuencia. Si no se provee, se muestran todos los items.

import { HAS_PERMISSION_KEY } from '@greenborn/vue-side-menu'
import { provide } from 'vue'

provide(HAS_PERMISSION_KEY, (permiso) => usuario.permisos.includes(permiso))

vue-router

No es una dependencia obligatoria. Si vue-router está instalado y registrado globalmente, los items con to usan router-link (y reciben la clase router-link-exact-active). En caso contrario, esos items se renderizan como <a href>.

Desarrollo / Demo

npm install
npm run dev   # demo en http://localhost:5175
npm run build # genera dist/

Licencia

MIT