🔀 Merge pull request #349 from cgutierr-zgz/dev

Update button to add download tag
pull/339/head
James Panther 2022-11-07 16:36:42 +11:00 committed by GitHub
commit 8b2a5e02d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -55,7 +55,15 @@ New article!
## Button ## Button
`button` outputs a styled button component which can be used to highlight a primary action. It has two optional variables `href` and `target` which can be used to specify the URL and target of the link. `button` outputs a styled button component which can be used to highlight a primary action. It has three optional parameters:
<!-- prettier-ignore-start -->
|Parameter|Description|
|---|---|
|`href`|The URL that the button should link to.|
|`target`|The target of the link.|
|`download`|Whether browser should download the resource rather than navigate to the URL. The value of this parameter will be the name of the downloaded file.|
<!-- prettier-ignore-end -->
**Example:** **Example:**

View File

@ -2,6 +2,7 @@
class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700" class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
{{ with .Get "href" }}href="{{ . }}"{{ end }} {{ with .Get "href" }}href="{{ . }}"{{ end }}
{{ with .Get "target" }}target="{{ . }}"{{ end }} {{ with .Get "target" }}target="{{ . }}"{{ end }}
{{ with .Get "download" }}download="{{ . }}"{{ end }}
role="button" role="button"
> >
{{ .Inner }} {{ .Inner }}