0.0.5 • Published 9 months ago

wc-flow-layout v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

WC Flow Layout

The wc-flow-layout is a high performance flow layout component written using web-component

It can support running in various frameworks, such as React Vue SolidJs

image

🌈 Demo

⚙️ Installation

  • npm

npm i wc-flow-layout
  • scripts

<script src="https://cdn.jsdelivr.net/npm/wc-flow-layout/dist/index.iife.js"></script>

🦄 Example

🐔 Use in VanillaJS

import 'wc-flow-layout'
<wc-flow-layout gap="10" cols="3">
  <div>01</div>
  <div>02</div>
  <div>03</div>
  <div>04</div>
  <div>05</div>
  <div>06</div>
</wc-flow-layout>

🐔 Use in React

// App.tsx
import 'wc-flow-layout'

export default function MyApp() {
  return (
    <wc-flow-layout gap={10} cols={3}>
      <div>01</div>
      <div>02</div>
      <div>03</div>
      <div>04</div>
      <div>05</div>
      <div>06</div>
    </wc-flow-layout>
  )
}

🐔 Use in Vue

// main.ts
import 'wc-flow-layout'
<!-- App.vue -->
<template>
  <wc-flow-layout :gap="10" :cols="3">
    <div>01</div>
    <div>02</div>
    <div>03</div>
    <div>04</div>
    <div>05</div>
    <div>06</div>
  </wc-flow-layout>
</template>
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: { isCustomElement: (tag) => tag.startsWith('wc-') }
      },
    })
  ],
})

📄 Props

NameTypeDefaultDescription
colsnumber2Number of columns
gapnumber4Interval between cells

⭐️ Show Your Support

Please give a ⭐️ if this project helped you!

👏 Contributing

If you have any questions or requests or want to contribute, please write the issue or give me a Pull Request freely.

0.0.5

9 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago