novacbn / kahi-ui

Straight-forward Svelte UI for the Web
https://kahi-ui.nbn.dev
MIT License
188 stars 5 forks source link

Is it possible to add the sveltekit specific attribute to an "a" button ? #100

Closed MichaelBailly closed 2 years ago

MichaelBailly commented 2 years ago

Describe the Question

Hello,

I'm looking for how to add the property sveltekit:prefetch to a button with an href. The doc is here https://kit.svelte.dev/docs#anchor-options-sveltekit-prefetch .

<Button href="/mysite/page2"></Button>

How can I tell Kahi to add the sceltekit:prefetch attribute?

novacbn commented 2 years ago

Sorry, I should document that! The framework already supports that on all link Components. Did a quick test a Playground REPL, seems to be rendering to DOM fine with those attributes. So I believe they should work.

button-anchor-sveltekit-attributes

Let me know if it doesn't actually function properly.

MichaelBailly commented 2 years ago

I confirm, that works! Thank you.