npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

buttons-svelte

v0.9.9

Published

Buttons-Svelte is a library for Svelte, providing a collection of reusable button components. These components are designed to be highly customizable, allowing developers to easily create visually appealing buttons for their Svelte applications.

Downloads

1

Readme

Buttons-Svelte

Buttons-Svelte

Buttons-Svelte is a library for Svelte, providing reusable button components.

Introduction

Buttons-Svelte is a powerful and flexible library for creating beautiful and interactive buttons in Svelte applications. It offers a wide range of customization options, allowing you to create buttons with various colors, sizes, padding,margins, events and transitions.

Features

  • Easy-to-use button components for Svelte applications.
  • Customize button color, text color, padding, and margins.
  • Choose from a variety of predefined button colors or use custom colors.
  • Adjust the font size and font family to match your design.
  • Lightweight and optimized for performance.

Installation

You can install the buttons-svelte library using npm:

npm install buttons-svelte

Usage

To use the button components in your Svelte project, import them from the library:

<script>
  import { Button } from "buttons-svelte";
</script>

<Button>Click Me</Button>
<Button btnColor="btn-red-500">Button</Button>
<Button btnColor="btn-green-600">Button</Button>
<Button btnColor="btn-blue-500">Button</Button>
<Button btnColor="#ff00ff">Button</Button>

Available Props

The Button component accepts the following props:

| Props | Type | Default Type | Description | | -------- | ------- | ------------- | --------------| | btnColor | string | " " | Custom CSS property to apply buttoncolor. | | onClick | function | null | Event handler function for button click. | | onMouseOver| function | null | Event handler function for mouse pointer is over the button. | | onMouseOut| function | null | Event handler function for mouse pointer leaves the button. | | textColor| string | " " | Custom CSS property for text color. | | textSize | string | " " | Custom CSS property for text size. | | padding | string | " " | Custom CSS property for padding. |
| margin | string | " " | Custom CSS property for margin. | | border | string | " " | Custom CSS property for border. | | borderRounded| string | " " | Custom CSS property for rounded border.| | fontFamily | string | " " | Custom CSS property for font family.| | fontWeight | string | " " | Custom CSS property for font weight.|

Examples

Basic Usage
<script>
  import { Button } from "buttons-svelte";
</script>

<Button>Click Me</Button>

Handling Click Events

<script>
  import { Button } from "buttons-svelte";

  const handleClick = () => {
    console.log("Button clicked!");
  };
</script>

<Button onclick={handleClick}>Click Me</Button>

Customizing Buttons

<script>
  import { Button } from "buttons-svelte";
</script>

<Button btnColor="btn-red-500" padding="p-6" textColor="green" textSize="text-2">Click Me</Button>
<Button btnColor="btn-blue-500" padding="p-8" textColor="white" textSize="text-4">Submit</Button>
<Button btnColor="#ff00ff" padding="p-10" textColor="black"textSize="text-6">Cancel</Button>

Margin

<script>
  import { Button } from "buttons-svelte";
</script>

<Button margin="5px">Click Me</Button>
<Button margin="10px 20px">Click Me</Button>
<Button margin="10px 40px 10px 40px">Click Me</Button>
<Button margin="m-2">Click Me</Button>

Padding

<script>
  import { Button } from "buttons-svelte";
</script>

<Button padding="10px">Click Me</Button>
<Button padding="10px 20px">Click Me</Button>
<Button padding="10px 40px 10px 40px">Click Me</Button>
<Button padding="p-2">Click Me</Button>

CSS Units

px rem em % Use any for styling purpose

Contributing

Contributions Yes please! See the contributing guidelines for details. contributing guidelines.

License

By contributing to the buttons-svelte library, you agree that your contributions will be licensed under the [MIT License]

Thank you for contributing to buttons-svelte! Your help is greatly appreciated!