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-flipper

v1.0.0

Published

A component to flip elements with a nice transition.

Downloads

561

Readme

vue-flipper

License Library size Dependencies

A component to flip elements with a nice transition.

  • :zap: It is really small, JavaScript + CSS (min + gzip) is smaller than 1KB

  • :art: CSS uses Stylus + BEM + Autoprefixer

  • :package: There are ESM, CommonJS and UMD distributions

You can se by youself on Codepen or CodeSandbox.

Installation

This library is published in the NPM registry and can be installed using any compatible package manager.

npm install vue-flipper --save

# For Yarn, use the command below.
yarn add vue-flipper

Usage

Just import Flipper component from 'vue-flipper' and use it like any other Vue component.

<template>
  <flipper
    width="270px"
    height="300px"
    :flipped="flipped"
    @click="onClick"
  >
    <div slot="front">Frontface</div>

    <div slot="back">Backface</div>
  </flipper>
</template>

<script>
import Flipper from 'vue-flipper';

export default {
  components: { Flipper },
  data () {
    return {
      flipped: false
    };
  },
  methods: {
    onClick () {
      this.flipped = !this.flipped;
    }
  }
};
</script>

<style src="vue-flipper/dist/vue-flipper.css" />

Usage as global component

If you need <flipper /> available everywhere, you can register it as a global component.

And don't forget to import its CSS.

import 'vue-flipper/dist/vue-flipper.css';
import Vue from 'vue';
import Flipper from 'vue-flipper';

Vue.component('flipper', Flipper);

Usage from CDN

vue-flipper has an UMD bundle and CSS available through JSDelivr and Unpkg CDNs.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vue-flipper/dist/vue-flipper.css" />

<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-flipper"></script>

<script>
  /**
   * vue-flipper is available through VueFlipper.
   */
  console.dir(VueFlipper);

  /**
   * Vue.use will add flipper as global component.
   */
  Vue.component('flipper', VueFlipper);
</script>

Props

| Name | Description | Type | Default |:---- |:----------- |:---- |:------- | flipped | If true flips to backface, otherwise to frontface. | Boolean | false | width | Component's width. | CSSLength (String) | '100%' | height | Component's height. | CSSLength (String) | '100%' | duration | Component's transition duration. | CSSTime (String) | '0.5s' | transition | Component's transition timing function. | CSSTransitionFunction (String) | 'ease-in'

Events

Flipper component pass up every HTMLElement event. So, you can use @click, @mouseover etc.

License

Released under MIT License.