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

dashboard-layout-vue

v0.0.7

Published

A simple dashboard layout for Vue

Downloads

14

Readme

dashboard-layout-vue

Vue 3 basic responsive layout for admin dashboards. Fullscreen Mobile

Disclaimer

I'm a beginner and this layout is mostly for my own use.
Work in progress
I probably won't be looking at issues, but you're free to fork and modify as you wish.

Setup

Requires

  • Vue 3
  • IonIcons
  1. Add IonIcons as described on their website. Example:
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
  1. Include in main.js
import { createApp } from 'vue'
import App from './App.vue'
import DashboardLayout from 'dashboard-layout-vue' // <-- This
import 'dashboard-layout-vue/styles.css' // <-- This

const app = createApp(App);
app.use(DashboardLayout) // <-- This

app.mount('#app')

Example usage

<script setup>
import { computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()

function handleClick(pageTo){
  router.push({ path: pageTo})
}

const currentRoute = computed(() => route.path)

</script>

<template>
  <DashboardLayout primaryColor="#E91E63" @buttonClicked="handleClick" :currentRoute="currentRoute">
    <template v-slot:sidebar-logo>
      <div class="logo">My Logo</div>
    </template>
    <template v-slot:header>
      Something in the header
    </template>
    <template v-slot:content>
    </template>    
  </DashboardLayout>
</template>

Props

| Prop | Description | Example | |--|--|--| | menu | The menu | See below | | mobileBreakpoint | Mobile breakpoint | 1024 | | backgroundColor | Background color (the lightest) | '#fff' | | contentBackgroundShade | Shading percentage for content container | -0.05 | | currentRoute | The current route from the useRoute() object | '/app/option1' | | primaryColor | Brand color | '#4361ee' | | fontColor | Font color | '#494c5c' | | sidebarWidth | Width of the sidebar | '16rem' |

Example menu

[
  {
    section: "Section 1",
    options: [
      {
        id: 'option-1',
        displayText: "Option 1",
        to: "/app/option1",
        ionIcon: "pie-chart-outline"
      },
      {
        id: 'option-child',
        displayText: "Option w/ children",
        ionIcon: "chatbubbles-outline",
        children: [
          { id: 'child-1', displayText: "One child", to: "/app/child", ionIcon: "flask-outline" },
          { id: 'child-2', displayText: "Another child", to: "/app/child", ionIcon: "pricetag-outline" },
        ],
      },
      {
        id: 'option-2',
        displayText: "Option 2",
        to: "/app/option2",
        ionIcon: "flash-outline"
      }    
    ]
  },
  {
    section: "Section 2",
    options: [
      {
        id: 'option-3',
        displayText: "Option 3",
        to: "/app/option3",
        ionIcon: "fish-outline"
      }      
    ]
  },
]

Slots

| Slot | Example | |--|--| | header | | | content | | | sidebar-logo | |

Events

| Event | Description | Example Payload | |--|--|--| | buttonClicked | When an element from a sidebar is clicked | '/app/option1' |

Bye.