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'
    }
  }
}
Support

You can subscribe on YouTube, or consider becoming a patron if you want to support my work.

Patreon
Found a mistake?

Every post is a Markdown file so contributing is simple as following the link below and pressing the pencil icon inside GitHub to edit it.

Edit on GitHub