Svelte
Use the Genshi components inside Svelte components using a native API.
<button type="button" class="GenshiButton GenshiButton--md">A button</button>
becomes just:
<Button size="md">A button</Button>
Install
Install @makigas/genshi-svelte, available both from npm and the GitHub Packages
Registry. Keep in mind that you also need the base @makigas/genshi too:
npm add @makigas/genshi @makigas/genshi-svelte
pnpm add @makigas/genshi @makigas/genshi-svelte
yarn add @makigas/genshi @makigas/genshi-svelte
Keep in mind that Genshi right now is alpha and may have breaking changes. Pin your version until 1.0.0 is released, and read the changelog before updating.
{
"dependencies": {
"@makigas/genshi": "1.0.0-alpha.2",
"@makigas/genshi-svelte": "1.0.0-alpha.2"
}
}
Then you can start importing components from Svelte code. Remember to also add the stylesheet in your global scope.
<script>
import "@makigas/genshi";
import { Link, Button, Stack } from "@makigas/genshi-svelte";
</script>