themesberg / flowbite-svelte

Official Svelte components built for Flowbite and Tailwind CSS

Home Page:https://flowbite-svelte.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow specifying the link `target` attribute in the `Button` component

th0rgall opened this issue · comments

Motivation

<Button> has a href attribute, but it does not allow the target attribute to be set. This is for example necessary to have to specify a button that should open a link in a new tab (target="_blank"). Currently, buttons can only open links in the same tab.

This issue is similar to this closed <FooterLink> issue: #403

Since it has ...$$restProps, you should be able to add it.

Ah, thank you! I missed that. It indeed just works.

I was looking at the .d.ts declaration and docs and didn't see a target property, but didn't realize that [x: string]: any; was present together with ...$$restProps.