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

windi-vue

v0.0.1-beta.4

Published

Build Accessible Apps 10x faster

Downloads

2

Readme

Features

  • 🦾 TypeScript Support - Built with TypeScript in mind and from the ground up.
  • 🔥 Icon - Use any icon from Iconify in your project from your favourite icon set.
  • 🛠️ On Demand Import - Windi UI comes with an intelligent resolver that automatically imports only used components.
  • 📦 Diverse Component Selection - Create your application effortlessly with our expansive collection of 50+ UI components.
  • ⚡️ Powerful Tools - Windi UI is built on top of powerful tools such as TailwindCss, VueUse, Headless UI etc.
  • 🎨 Themeable - Customize any part of our beautiful components to match your style.

Getting Started

Add Windi UI to your project by running one of the following commands:


# pnpm
pnpm add windi-vue

# yarn
yarn add windi-vue

# npm
npm install windi-vue

Usage

  1. Add the Windi UI theme file and the darkMode class in your tailwind.config.cjs file as shown below:
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}', 'node_modules/windi-vue/dist/theme/*.{js,jsx,ts,tsx,vue}'],
  darkMode: 'class',
  theme: {
    extend: {},
  },
  plugins: [],
}

Component registration

With Windi UI, you have the flexibility to register components precisely as you wish:

Import All Components

To import all the components provided by Windi UI, add WindiUI in your main entry file as shown below:

import { createApp } from 'vue'
import windiTheme from 'windi-vue/dist/theme/windiTheme'
import WindiUI from 'windi-vue'
import App from './App.vue'

const app = createApp(App)
app.use(WindiUI, windiTheme)
app.mount('#app')

By doing this, you are importing all the components that are provided by Windi UI and in your final bundle all the components including the ones you didn't use will be bundled. Use method of component registration if you are confident that you will use all the components.

Individual Components with Tree Shaking

Probably you might not want to globally register all the components but instead only import the components that you need. You can achieve this by doing the following:

  1. Import the createWindiUI option as well as the components you need as shown below:
import { createApp } from 'vue'
import './style.css'
import windiTheme from 'windi-vue/dist/theme/windiTheme'

import { WKbd, createWindiUI } from 'windi-vue'

import App from './App.vue'

const app = createApp(App)

const UI = createWindiUI({
  prefix: 'T',
  components: [WKbd],
})

app.use(UI, windiTheme)

app.mount('#app')
  1. Now you can use the component as shown below:
<template>
  <div>
    <TKbd>K</TKbd>
  </div>
</template>

The prefix option is only available for individual component imports.

Auto Imports with Tree Shaking

Windi UI comes with an intelligent resolver that automatically imports only used components.

This is made possible by leveraging a tool known as unplugin-vue-components which lets you auto import components on demand thus omitting import statements and still get the benefits of tree shaking.

To achieve this you need to do the following:

  1. Install the unplugin-vue-components package by running one of the following commands:

#pnpm
pnpm add -D unplugin-vue-components

#yarn
yarn add -D unplugin-vue-components

#npm
npm i -D unplugin-vue-components
  1. Head over to your main.ts or main.js file and set registerComponents to false as shown below:
import { createApp } from 'vue'
import './style.css'
import windiTheme from 'windi-vue/dist/theme/windiTheme'

import { createWindiUI } from 'windi-vue'

import App from './App.vue'

const app = createApp(App)

const UI = createWindiUI({
  registerComponents: false,
})

app.use(UI, windiTheme)

app.mount('#app')
  1. Head over to your vite.config.ts or vite.config.js file and add the following:
// other imports
import { WindiUIComponentResolver } from 'windi-vue'
import Components from 'unplugin-vue-components/vite'

export default defineConfig({
  plugins: [
    // other plugins
    Components({
      resolvers: [
        WindiUIComponentResolver()
      ]
    }),
  ],
})
  1. Now you can simply use any component that you want and it will be auto imported on demand ✨
<template>
  <div>
    <WKbd>K</WKbd>
  </div>
</template>

Troubleshooting TypeScript Error

If you're encountering the TypeScript error: Cannot find module 'windi-vue/dist/theme/windiTheme' or its corresponding type declarations, you can follow these steps to resolve it:

  1. Create a windi-vue.d.ts declaration file in your src directory and inside it paste the following code:
declare module 'windi-vue/dist/theme/windiTheme'

The error should now be resolved.

This issue is set to be fixed in the next release of Windi UI v0.0.1 Alpha

🥳 Well done, you can now go ahead and build your web application with ease.

Contributions

Contributions are welcome and encouraged! If you have any ideas or suggestions for new features, or if you encounter any bugs or issues, please open an issue or submit a pull request on the GitHub repository.

Developers interested in contributing should read the Code of Conduct and the Contributing Guide.

Credits

License

MIT License © 2023 Selemondev