🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@isoftdata/svelte-button

Package Overview
Dependencies
Maintainers
12
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-button

latest
npmnpm
Version
2.2.2
Version published
Maintainers
12
Created
Source

Svelte Button

This component will conditionally render a HTML <button> or <a> element based on if a href prop is passed. This component uses Svelte's spread attributes to apply any additional props you pass as attributes on the HTML element.

Install

npm i @isoftdata/svelte-button

Breaking changes

2.0.0

  • Require Svelte 5
  • Slots -> Snippets
  • Events -> Callbacks
  • Deprecate iconClass prop. The icon prop can now accept an icon name or an object
  • Removed block prop. Bootstrap 5 no longer supports the btn-block class. Apply d-block w-100 classes for the same behavior.

Props

PropTypeDescriptionDefault
buttonHTMLButtonElement | HTMLAnchorElementEither the <button> or <a>. Useful if you want to fire events directly on it.(The button or anchor tag)
color"primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link"The bootstrap color of the button."primary"
colorGreyDisabledbooleanWhether the button is greyed out when disabled.true
disabledbooleanWhether the button is disabled.false
downloadstring | nullThe filename to download when the button is clicked.null
hrefstring | nullThe URL to link to when the button is clicked.null
iconIconName | ComponentProps<typeof Icon>The name of a FontAwesome icon, or an object of Icon component props.{ class: "", color: null, style: null, prefix: "fas", fixedWidth: true, icon: null }
idstring | nullThe ID of the button.null
outlinebooleanWhether the button is outlined.false
size"" | "xs" | "sm" | "lg"The size of the button.""
stylestring | nullThe inline style of the button.null
targetstring | nullThe target of the link when the button is clicked.null
textClassstring | nullAny classes to apply to the button textnull
titlestring | nullThe title of the button.null
type"button" | "submit" | "reset"The type of the button."button"
wrapbooleanWhether the button should wrap its contents.false
isLoadingbooleanWhether the button is showing a loading icon (and disabled)false

Any extra props (such as onclick) are applied to the button/anchor tag as well.

Example

<script>
	import Button from "@isoftdata/svelte-button"
</script>

<Button
	color="primary"
	icon="0"
	onclick={() => alert("Clicked!")}
	>
	Click Me!
</Button>
<Button
	color="danger"
	outline
	icon={ { icon: "1" } }
	size="xs"
	href="https://google.com"
	target="_blank"
>
	Google
</Button>

FAQs

Package last updated on 27 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts