Quickstart - Svelte Shields
Svelte Shields is a collection of Shields badges for Svelte Runes.
Installation #
# install svelte 5
npm create svelte@latest my-project
# install svelte-shields
pnpm i -D svelte-shields
Enable Runes in svelte.config.js
:
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [vitePreprocess({})],
compilerOptions: {
runes: true
},
kit: {
adapter: adapter()
}
};
export default config;
Basic usage #
<script lang="ts">
import { NpmVersion, type NpmVersionPropsType } from 'svelte-shields';
const basic: NpmVersionPropsType = {
packageName: 'svelte-shields',
logo: 'svelte',
label: 'Svelte Shields'
};
</script>
<NpmVersion {...basic} />