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-slide-up-down

v3.0.0

Published

Like jQuery's slideUp/slideDown, but for Vue!

Downloads

42,418

Readme

vue-slide-up-down

Like jQuery's slideUp / slideDown / [slideToggle], but for Vue!

Demo: https://codepen.io/danieldiekmeier/pen/YapGWq

Installation

npm i vue-slide-up-down
import { createApp } from 'vue'
import SlideUpDown from 'vue-slide-up-down'

const app = createApp({ ... })
app.component('slide-up-down', SlideUpDown)

[!NOTE] Version 3 of this package is only compatible with Vue 3. If you're still on Vue 2, install the previous version with npm i vue-slide-up-down@2

Usage

<div class="MyContent">
  <h1>Always show this</h1>

  <slide-up-down :active="active" :duration="1000">
    Only show this if "active” is true
  </slide-up-down>
</div>

The component takes four props:

  • active (Boolean, required): Whether to show the component (true) or not (false)

  • duration (Number, optional): How long the animation is supposed to be, in milliseconds. Defaults to 500.

  • tag (String, optional): Which HTML tag to use for the wrapper element. Defaults to div.

  • use-hidden (Boolean, optional): Whether to apply the hidden attribute to the element when closed. Defaults to true. This hides the component from the screen and from assistive devices. The internal elements of the component are completely invisible, and can't be focused (by a keyboard or assistive device). (This is probably what you want!)

    If you really need to, you can set this property to false to not use the hidden attribute. For example if you want to have a min-height on your component and not actually transition to a height of 0.

    ⚠️ Be aware that this can create accessibility issues, specifically for users with a keyboard or screen reader. Even though the component may appear hidden, focusable elements within the component are still able to be accessed through keyboard navigation.

The component emits four events:

  • open-start
  • open-end
  • close-start
  • close-end
<slide-up-down @close-end="console.log('done closing!')" />

Custom transition-timing-function

If you want to use a different timing function, add some CSS for your <slide-up-down> element. (See demo/index.html for a full example.)

<style>
  .wobbly-accordion {
    transition-timing-function: cubic-bezier(0.195, 1.65, 0.435, -0.6);
  }
</style>

<slide-up-down class="wobbly-accordion">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta omnis velit
  ab culpa, officia, unde nesciunt temporibus cum reiciendis distinctio.
</slide-up-down>