tauri-plugin-vicons

Crates.iotauri-plugin-vicons
lib.rstauri-plugin-vicons
version2.0.2
created_at2025-07-04 16:00:24.396257+00
updated_at2025-08-19 17:34:12.398451+00
descriptionIcon API for Tauri plugins (Created for VasakOS)
homepage
repositoryhttps://github.com/Vasak-OS/tauri-plugin-vicons/
max_upload_size
id1738178
size179,249
Joaquin (Pato) Decima (JoaquinDecima)

documentation

README

Tauri Plugin vicons

A simple plugin that allows you to get the operating system icons by name (only works on Linux) by getting it in base64 ready to use the src of any image

Installation

bun add @vasakgroup/plugin-vicons

Add in cargo.toml

[dependencies]
tauri-plugin-vicons = { git = "https://github.com/Vasak-OS/tauri-plugin-vicons", branch = "v2" }

In main.rs or lib.rs, add the following to your tauri::Builder:

use tauri_plugin_vicons;
fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_vicons::init()) // this line
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

And add in src-tauri/compatibilites/default.json

{
  "permissions": [
    ...
    "vicons:default",
  ]
}

Usage

import { getIconSource } from '@vasakgroup/plugin-vicons';

const icon = await getIconSource('folder');

in vue

<script setup lang="ts">
import { getIconSource } from '@vasakgroup/plugin-vicons';
import { ref } from 'vue';
const icon = ref('');
const getIcon = async () => {
  icon.value = await getIconSource('folder');
};
getIcon();
</script>

<template>
  <img :src="icon" />
</template>
Commit count: 29

cargo fmt