Say a dashboard starts in React and a second version is built in Vue or Svelte. How do you keep Team pointing to the same icon in all three?

For this demo, I built the same three-row sidebar in React with TypeScript, Vue 3, and Svelte 5. All three read the same SVGs for Overview, Team, and Settings.

Pick the icons once

Sidebar label Source SVG
Overview layout-dashboard.svg
Team users.svg
Settings settings.svg

The demo loads those three SVGs from one icons.json file. React reads the array in its component, and the entry point passes that same array to Vue and Svelte. Each implementation handles its own pressed state.

Render the Team row

Here is the same row pulled out of each sidebar. index is the row's position, label is the visible name, and active tracks which row is pressed.

React

<button type="button" aria-pressed={active === index} onClick={() => setActive(index)} > <span className="glyph" dangerouslySetInnerHTML={{ __html: icons[index] }} /> {label} </button> 

Vue

<button type="button" :aria-pressed="active === index" @click="active = index" > <span class="glyph" v-html="icons[index]"></span>{{ label }} </button> 

Svelte

<button type="button" aria-pressed={active === index} onclick={() => active = index} > <span class="glyph">{@html icons[index]}</span>{label} </button> 

These snippets show how the demo renders SVG markup bundled with the project. Use these HTML insertion APIs only with SVG markup you trust.

Let the row set the color

The icon drawings use stroke="currentColor", so one CSS rule sets the color of both the label and the drawing when you press the row.

nav button[aria-pressed="true"] { color: #9af0da; background: #234340; } 

Each SVG is marked aria-hidden="true" because the visible label already names the button.

Change one icon and rebuild

As a quick test, I replaced the SVG for Team with the existing Overview drawing in the shared icon data and rebuilt. The repeated drawing made the change easy to spot.

Checked in Chromium Result
Team icon after the rebuild Changed in React, Vue, and Svelte
Overview and Settings icons Stayed the same
Sidebar component files No edits needed
Pressed icon color rgb(154, 240, 218) in all three frameworks

That test changed the demo's shared SVG data directly. For a project where each app imports its own icon components, the equivalent check is to re-export the assets, then see whether the generated filenames and exports still match your imports. If the names change, update those imports or keep a stable alias for the navigation action.

For a real project, start with the icons used in one screen. Save them together in SVGicons Icon Collections and choose the component export for the framework you use.

Icon artwork by Lucide Contributors under the Lucide license.