Never Search For Svelte Components Again
Published Sep 9, 2022
Table of Contents
The Svelte Inspector
The Svelte Inspector is part of the @sveltejs/vite-plugin-svelte
package found in most Svelte and SvelteKit projects which helps you find any element on the page in your code editor:
This post has been updated for Svelte 5 and the same instructions should work for any Vite based Svelte and SvelteKit project.
Enabling The Svelte Inspector
To enable the Svelte Inspector inside your project, open the Svelte config:
svelte.config.js
export default {
vitePlugin: {
inspector: true
}
}
Configuration
You can start using the Svelte Inspector by pressing the Alt + X shortcut by default and configure the plugin options if you want:
svelte.config.js
export default {
vitePlugin: {
inspector: {
toggleKeyCombo: 'alt-x',
showToggleButton: 'always',
toggleButtonPos: 'bottom-right'
}
}
}