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

vue-cool-box-selector

v3.0.4

Published

Fancy, versatile box, button, image selector for Vue 2 and 3

Downloads

23

Readme

License Code Style

Vue Cool Box Selector ✅

Code Style

Versatile element selector for vue. It can convert anything to a checkbox button.

Features

  • Flexible, choose from any element (division, button, image or custom component)
  • Headless, use our provided style or your own classes
  • Works with Vue 2 and 3
  • Lightweight ~1KB gzipped

Usage

Setup

npm install vue-cool-box-selector
##OR
yarn add vue-cool-box-selector
##OR
pnpm i vue-cool-box-selector

Note: Use version 2 for Vue 2

Global Use

import VueCoolBoxSelector from 'vue-cool-box-selector'

// Optional, you can use your own classes
import 'vue-cool-box-selector/dist/style.css'

// For Vue 2
import Vue from 'vue'

Vue.use(VueCoolBoxSelector)

// or Vue 3
app.use(VueCoolBoxSelector)

Local Use

import { CoolBoxItem, VueCoolBoxSelector } from 'vue-cool-box-selector'

const component = {
  components: {
    VueCoolBoxSelector,
    CoolBoxItem,
  },
}

Basic Usage

<div>
Selected box: {{ selected }}
<VueCoolBoxSelector v-model="selected" active-class="cb__active">
  <CoolBoxItem name="Item1" class="vue-cool-box-selector__item" key="1">
    Item Box 1
  </CoolBoxItem>
  <CoolBoxItem name="Item2" class="vue-cool-box-selector__item" key="2">
    Item Box 2
  </CoolBoxItem>
  <CoolBoxItem name="Item3" class="vue-cool-box-selector__item" key="3">
    Item Box 3
  </CoolBoxItem>
</VueCoolBoxSelector>
</div>

Another Example

<!-- replace cb__square with cb__circle or cb__triangle for more styles -->
<VueCoolBoxSelector v-model="selected" active-class="cb__active cb__square">
<CoolBoxItem key="1" name="Item1" class="vue-cool-box-selector__item px-3" style="width:48px;text-align:center">
  <img src="/img.svg" alt=""/>
  <small>Img1</small>
</CoolBoxItem>
<CoolBoxItem key="2" name="Item2" class="vue-cool-box-selector__item px-3" style="width:48px;text-align:center">
  <img src="/img2.svg" alt=""/>
  <small>Img2</small>
</CoolBoxItem>
</VueCoolBoxSelector>

Props

  • VueCoolBoxSelector

    • active-class (String): Will be added to the item if it is selected.
    • tag (String) (Default: 'div')
  • CoolBoxItem

    • name (String) (Required)
    • tag (String) (Default: 'div')

Style

  • VueCoolBoxSelector class:
    • vue-cool-box-selector__item
      • Require if you want to use below classes
  • CoolBoxItem active-class:
    • cb__active
    • cb__active, cb__square
    • cb__active, cb__circle
    • cb__active, cb__triangle

Change Style Color

/* vue-cool-box-selector color */
.cb__active, .cb__triangle:before {
    border-color: violet; /* var(--bs-primary) */
}

.cb__square:after, .cb__circle:after, .cb__triangle:after {
    background-color: violet; /*  var(--bs-primary) */
}

Cheers

Love my works? give me 🌟 or follow for more works! → Follow me on Github

Requirement

  • node.js > 16

Thanks

  • Faizal Andyka for vivu-npm

License

MIT License © 2023 Hassan Jahan