Skip to content

feat(icons): add Material Symbols iconset via UnoCSS#22680

Merged
J-Sek merged 1 commit intomasterfrom
feat/material-symbols-via-unocss
Mar 11, 2026
Merged

feat(icons): add Material Symbols iconset via UnoCSS#22680
J-Sek merged 1 commit intomasterfrom
feat/material-symbols-via-unocss

Conversation

@J-Sek
Copy link
Copy Markdown
Contributor

@J-Sek J-Sek commented Mar 4, 2026

resolves #20053

  • adds aliases for UnoCSS-based icon set Material Symbols
  • tradeoff: avoids bloating the app with ~400kB font files, but does not allow changing width and opsz
  • note: replacement icon for missing cloud_upload

PR verification

Instructions to run the last snippet as dev/Playground.vue

  1. install dependencies
cd packages/vuetify
pnpm i -D unocss @iconify-json/material-symbols
  1. add UnoCSS for dev Playground setup
// in dev/vuetify.js
import 'virtual:uno.css'
  1. add uno.config.ts
import { defineConfig } from 'unocss'
import presetIcons from '@unocss/preset-icons'

export default defineConfig({
  presets: [presetIcons()],
})
  1. add line in vite.config.ts
import UnoCSS from 'unocss/vite'

dev/Playground.vue — icon set comparison table
<template>
  <v-app theme="dark">
    <v-main>
      <v-container max-width="400">
        <v-table density="compact" height="calc(100vh - 32px)" fixed-header>
          <thead>
            <tr>
              <th class="text-left">Alias</th>
              <th v-for="set in iconSets" :key="set.name" class="text-center">{{ set.name }}</th>
            </tr>
          </thead>
          <tbody>
            <tr v-for="alias in allAliases" :key="alias">
              <td><code>${{ alias }}</code></td>
              <td v-for="set in iconSets" :key="set.name" class="text-center">
                <v-tooltip v-if="set.aliases[alias]" location="bottom">
                  <template #activator="{ props }">
                    <v-icon v-bind="props" :icon="set.aliases[alias]" />
                  </template>
                  <code>{{ set.aliases[alias] }}</code>
                </v-tooltip>
                <span v-else class="text-disabled">—</span>
              </td>
            </tr>
          </tbody>
        </v-table>
      </v-container>
    </v-main>
  </v-app>
</template>

<script setup>
  import { computed } from 'vue'
  import { aliases as mdiAliases } from '@/iconsets/mdi-svg'
  import { aliases as msAliases } from '@/iconsets/ms'

  const iconSets = [
    { name: 'MDI (SVG)', aliases: mdiAliases },
    { name: 'Material Symbols', aliases: msAliases },
  ]

  const allAliases = computed(() => {
    const keys = new Set()
    for (const set of iconSets) {
      for (const key of Object.keys(set.aliases)) {
        keys.add(key)
      }
    }
    return [...keys]
  })
</script>

<style>
.v-table thead th:not(:first-child) {
  writing-mode: sideways-lr;
  height: 200px;
}
</style>

@J-Sek J-Sek self-assigned this Mar 4, 2026
@J-Sek J-Sek added T: feature A new feature E: icons Icons composable labels Mar 4, 2026
@J-Sek J-Sek force-pushed the feat/material-symbols-via-unocss branch from 13000b7 to f461cf2 Compare March 4, 2026 21:45
@J-Sek J-Sek merged commit 6c463c1 into master Mar 11, 2026
16 checks passed
@J-Sek J-Sek deleted the feat/material-symbols-via-unocss branch March 11, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

E: icons Icons composable T: feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Support for Material Symbols

1 participant