
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
lucide-vue-next
Advanced tools
The lucide-vue-next package is a Vue 3 component library for using Lucide icons. Lucide is an open-source icon library that provides a wide range of customizable and scalable vector icons. The lucide-vue-next package allows developers to easily integrate these icons into their Vue 3 applications.
Icon Usage
This feature allows you to use Lucide icons in your Vue 3 components. By importing the LucideIcon component from lucide-vue-next, you can easily render any icon by specifying its name as a prop.
<template>
<div>
<LucideIcon name="activity" />
</div>
</template>
<script>
import { defineComponent } from 'vue';
import { LucideIcon } from 'lucide-vue-next';
export default defineComponent({
components: {
LucideIcon
}
});
</script>
Customizable Icons
Lucide icons are highly customizable. You can change their color, size, and other properties by passing additional props to the LucideIcon component. This makes it easy to adapt the icons to fit the design of your application.
<template>
<div>
<LucideIcon name="activity" color="red" size="48" />
</div>
</template>
<script>
import { defineComponent } from 'vue';
import { LucideIcon } from 'lucide-vue-next';
export default defineComponent({
components: {
LucideIcon
}
});
</script>
vue-feather-icons is a Vue component library for Feather icons, which are also open-source and similar in style to Lucide icons. Like lucide-vue-next, it provides a simple way to integrate icons into Vue applications. However, Lucide offers a broader range of icons and more customization options.
vue-awesome is a Vue component library for Font Awesome icons. It provides a wide range of icons and is well-known for its extensive collection. Compared to lucide-vue-next, vue-awesome offers more icons but may not have the same level of customization and modern design as Lucide icons.
heroicons is a set of free, MIT-licensed high-quality SVG icons for UI development. It is not specifically a Vue component library, but it can be used in Vue projects. Heroicons are similar in style to Lucide icons, but lucide-vue-next provides a more straightforward integration with Vue 3 applications.
Implementation of the lucide icon library for Vue 3 applications.
What is lucide? Read it here.
:warning: This version of lucide is for Vue 3, For Vue 2 got to lucide-vue-next
yarn add lucide-vue-next
# or
npm install lucide-vue-next
It's build with ESmodules so it's completely threeshakable. Each icon can be imported as a vue component.
You can pass additional props to adjust the icon.
<template>
<Camera
color="red"
:size="32"
/>
</template>
<script>
// Returns Vue component
import { Camera } from 'lucide-vue-next';
export default {
name: "My Component",
components: { Camera }
}
</script>
name | type | default |
---|---|---|
size | Number | 24 |
color | String | currentColor |
strokeWidth | Number | 2 |
defaultClass | String | lucide-icon |
You can also pass custom props that will be added in the svg as attributes.
<template>
<Camera fill="red" />
</template>
It is possible to create one generic icon component to load icons.
:warning: Example below importing all EsModules, caution using this example, not recommended when you using bundlers, your application build size will grow strongly.
<template>
<component :is="icon" />
</template>
<script>
import * as icons from "lucide-vue-next";
export default {
props: {
name: {
type: String,
required: true,
},
},
computed: {
icon() {
return icons[this.name];
},
},
};
</script>
<template>
<div id="app">
<Icon name="Airplay" />
</div>
</template>
FAQs
A Lucide icon library package for Vue 3 applications.
The npm package lucide-vue-next receives a total of 185,730 weekly downloads. As such, lucide-vue-next popularity was classified as popular.
We found that lucide-vue-next demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.