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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kassdoug/sidebaradv

v1.2.2

Published

Componente que gera uma sidebar com interação com contedo e barra superior

Readme

Sidebaradv

Ideia

Ser um componente para navegação do tipo sidebar, reutilizável para Angular +12.

Instalação

Execute o comando:

npm i @kassdoug/sidebaradv

Como usar

O componente serve para ser um 'layout' de página, interagindo com o conteúdo, de acordo com o movimento e localidade da barra lateral. Assim o melhor uso é sendo dentro de um componente que seja pai das páginas do seu aplicativo angular. Segue exemplo de hierarquia:

├───app
│   ├───components
│   │   ├───@layouts
│   │   │   ├───header
│   │   │   ├───topbar
│   │   │   └───layout.component.ts
│   │   ├───home
│   │   │   ├───home.component.ts
│   ├───app.module.ts

Faça o import dentro de seu app.module.

import { SidebaradvModule } from '@kassdoug/sidebaradv';

...

@NgModule({
  declarations: [..],
  imports: [
    ...
    SidebaradvModule,
  ],
  providers: [..],
  bootstrap: [..],
})
export class AppModule {}

Dentro de 'layout.component.ts, você teria a chamada do componente:

@Component({
  selector: 'app-layout',
  template: `

    <sidebaradv 
        [links]="links" 
        [header]="header"
        [topbar]="topbar"
        [permissions]="permissions"
        [usePermissions]="true"

        [withHover]="hover"
        [search]="search"
        [theme]="theme"
        [position]="position" 

    ></sidebaradv>

  `
})

onde todas as props da sidebar serão configuradas aqui. Esse componente funciona com um 'router-outlet' internamente, então pode-se renderizar componentes (páginas) nele. As rotas ficariam:

const routes: Routes = [
  {
    path: '',
    component: LayoutComponent,
    children: [
      { path: '', component: HomeComponent },
    ],
  },
];

Todas as páginas que vão interagir a partir da sidebar, serão filhos dela.

Configurando

Veja como configurar suas propriedades.

links

Prop que recebe um array de links para renderizar no front.

this.links = [
    {
        path: '/',
        label: 'Home',
        icon: '<i class="fa-solid fa-house"></i>',
        permissions: ['home'],
        tags: ['home', 'inicio'],
    },

    {
    id: 'components',
    label: 'Componentes',       
    icon:'<i class="fa-solid fa-boxes-packing"></i>',
    permissions: ['home'],
    links:[
        {
        path: '/sidebar',
        label: 'Sidebar',
        icon: '<i class="fa-solid fa-bars"></i>',
        tags: ['sidebar', 'barra lateral'],
        },    
        {
        path: '/table',
        label: 'Table',
        icon: '<i class="fa-solid fa-table"></i>',
        tags: ['table', 'tableadv'],
        },
    ]
    },
];

Neste exemplo temos um link HOME, um sublink COMPONENTES que engloba 2 links SIDEBAR e TABLE.

O padrão de link segue como acima, sendo as chaves dos objetos:

  • path -> caminho configurado nas rotas do app (opcional)
  • label -> texto a ser exibido em tela
  • icon -> icone da lib fontawesome (opcional)
  • permissions -> recebe um array de valores que podem ser usados para validar se um link é permitido ser exibido ao usuário (opcional)
  • tags -> palavras chaves usadas na busca por links, alem de buscar o label (opcional)
  • links -> quando um link recebe essa chave, ele se torna um sublink, contendo uma lista de links, importante não ter a chave path, ela indica um link final (opcional)
  • id -> chave que identifica o nome único de um conjunto de sublinks, uso com a chave links é obrigatória (opcional - uso com links)

Sempre deverá haver, ou um 'path', ou 'links', nunca os 2 no mesmo objeto. Uso de níveis em sublinks é infinito.

header

É o cabeçalho da barra lateral, podendo receber html simples, textos ou a inserção de um componente.

this.header = HeaderComponent

topbar

É uma barra superior, podendo receber html simples, textos ou a inserção de um componente.

this.topbar = TopbarComponent

permissions

Um array contendo uma lista de permissões que serão verificadas em cada link, exibindo ou não para o usuário.

usePermissions (default = False)

Determina se a barra precisa verificar permissões.

withHover (default = False)

Altera o modo como a barra se comporta.

  • True -> a barra esconde/mostra ao passar/tirar o mouse de cima.
  • False -> a barra fica fixa ate que o botao de fechamento ou abertura seja clicado

search (default = '')

Texto a ser pesquisado nos links (label e tags)

theme (default = white)

Temas que alteram a cor da barra e barra superior.Temos light e dark.

position (default = left)

Define a posição da barra. Temos left e right.

Favoritos

O componente conta com sistema de favoritos no browser, existe um icone de estrela na frente de cada link, podendo tirar ou adicionar como favorito ao clicar nesse icone.

Mobile

Para telas menores que 720px, o componente altera sua configuração, abrangendo a tela toda e trabalhando sem 'hover' (withHover = false).

Temas

Temos 2 temas configurados light (default), dark.