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-flex-waterfall

v2.3.1

Published

A horizontal sorting waterfall layout component for Vue.js, realized by flex layout

Downloads

1,326

Readme

vue-flex-waterfall

Version License

中文文档

A horizontal sorting waterfall layout component for Vue 3, realized by flex layout.

Refer to CSS masonry with flexbox, :nth-child(), and order.

Version 2 requires Vue 3. If you are looking for a Vue 2 compatible version, use version 1.

Demo

Vue Flex Waterfall Demo

Source code of demo

Installation

Requirements

Vue ^3.0.0

Node

npm i vue-flex-waterfall

Browser

UNPKG

<script src="https://unpkg.com/vue-flex-waterfall@2"></script>

jsDelivr

<script src="https://cdn.jsdelivr.net/npm/vue-flex-waterfall@2"></script>

Usage

<template>
  <VueFlexWaterfall
    align-content="center"
    col="4"
    col-spacing="16"
    :break-at="{ 900: 3, 600: 2, 300: 1 }"
  >
    <!-- items -->
  </VueFlexWaterfall>
</template>

<script setup>
import { VueFlexWaterfall } from 'vue-flex-waterfall';
</script>

Props

align-content

Type: String

Default: undefined

Equal to align-content CSS value of the container.

MDN document

height

Type: Number | String

Default: undefined

You can specify the height of the container. If not, height will be calculated automatically.

The unit is px when it is a number.

col

Type: Number | String

Default: 1

Default number of column. Use the break-at prop to specify breakpoints for this value.

col-spacing

Type: Number | String

Default: 0

Column spacing. The unit is px when it is a number.

Please note that its performance is related to the align-content.

break-at

Type: Object

Default: {}

This object allows you to specify how the number of columns will change based on the width of the viewport.

Setting this option to { 900: 3 } for example will adjust the number of columns to 3 when the viewport change and is <= 900px.

break-by-container

Type: Boolean

Default: false

When enable, the breakpoints will be based on the container width instead of the window width.

Events

order-updated

Will be emitted after order of slot elements are updated.

Methods

updateOrder

You can call this method to trigger order updating.

How to call component method: see Vue Guide - ref

Tips

  1. You can set margin-bottom style for slot elements to control their vertical spacing.
  2. You can set the prop align-content to control column alignment.
  3. If there are elements that its size will change, such as images, please call updateOrder() after the size change or fixed the size.