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

sky-reveal

v0.4.4

Published

Vue component for grouped foldable content

Downloads

10

Readme

sky-reveal

Simple js module that collapses content

Installation

npm install sky-reveal

or

yarn add sky-revel

Usage

Begin by importing and installing the SkyReveal Vue plugin:

import Vue from 'vue';
import SkyReveal from 'sky-reveal';

// If you want to use the baseline scss add the following line
import '${YOUR-PROJECT-ROOT-PATH}/node_modules/sky-reveal/src/SkyReveal.scss';

Vue.use(SkyReveal);

There are two ways to use sky-reveal. The first one is as a stand-alone module where you provide a toggle button (sky-reveal-trigger) for the content to be revealed. Here you need to to use the attribute reveal-id with the same value on both sky-reveal and sky-reveal-trigger

 <sky-reveal reveal-id="asd">
    <p>
    Ullamco enim eiusmod nisi exercitation occaecat do culpa. Elit dolore nulla aliqua sunt. Ex id eu ea et quis ex pariatur veniam mollit amet laborum. Magna elit aute non est. Ullamco enim eiusmod nisi exercitation occaecat do culpa. Elit dolore nulla aliqua sunt. Ex id eu ea et quis ex pariatur veniam mollit amet laborum. Magna elit aute non est.
    </p>
</sky-reveal>

<sky-reveal-trigger reveal-id="asd">
	<svg slot="svg-prepend | svg | svg-append"></svg> (optional)
    <span slot="open">Show more</span>
    <span slot="closed">Show less</span>
</sky-reveal-trigger>

The other way to use sky-reveal is as a sub component which are provided with a bool in the open attribute like this. This will open / close sky-reveal

<sky-reveal :open="true | false">
    <p>
    Ullamco enim eiusmod nisi exercitation occaecat do culpa. Elit dolore nulla aliqua sunt. Ex id eu ea et quis ex pariatur veniam mollit amet laborum. Magna elit aute non est. Ullamco enim eiusmod nisi exercitation occaecat do culpa. Elit dolore nulla aliqua sunt. Ex id eu ea et quis ex pariatur veniam mollit amet laborum. Magna elit aute non est.
    </p>
</sky-reveal>

By default sky-reveal animates with a duration om 500ms. You can change this via the duration attribute.

<sky-reveal :open="true | false" :duration="750">
    ...
</sky-reveal>

Furthermore, sky-reveal emits a few callbacks you can utilize.

<sky-reveal
    reveal-id="asd"
    @open="onAnimationStartFn()"
    @open-done="onAnimationEndFn()"
    @close="onAnimationStartFn()"
    @close-done="onAnimationEndFn()"
>
    ...
</sky-reveal>

How it works

Sky-reveal uses animeJs as animation engine which handles initial state and animations from and to height. If the animation is to open sky-reveal it calculate auto height in pixel and animate towards this value and on completion set height: auto which will make the container responsive. if closing it will use the computed property min-height on .sky-reveal.

Credits

This module is made by the Frontenders at skybrud.dk. Feel free to use it in any way you want. Feedback, questions and bugreports should be posted as issues. Pull-requests appreciated!