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

@frankhoodbs/cta-button-cmp

v1.4.20

Published

Simple cta component

Downloads

266

Readme

Cta Button Component

Component that allows creating a button or a link, with advanced features for managing tags and associated properties, as well as slots for icons.

Componente che permette di creare un pulsante o un link, con funzionalità avanzate per la gestione dei tag e delle proprietà associate, nonché slot per icone.

Version License

API Reference

Props

| Name | Type | Description | |:----------------------|:-------------------|:------------------------------------------------------------------------------| | data-tag | string | Tag of the button. Can be one of the following: a, button, router-link. | | data-url | string | If data-tag is a, the href of the tag a. | | data-download | boolean | Indicates that the link is a file to download. | | data-filename | string | The file to download. | | data-target | string | If data-tag is a, the target of the tag a. | | data-rel | string | If data-tag is a, the rel of the tag a. | | data-referrerpolicy | string | If data-tag is a, the referrerpolicy of the tag a. | | data-type | string | If data-tag is button, the type of the tag button. | | data-to | string or object | If data-tag is router-link, the to attribute of the router-link. | | data-aria-label | string | The value of the aria-label. | | data-disabled | boolean | Indicates that the cta is disabled. | | data-loading | boolean | Indicates that the action triggered by the cta is in progress. |

Slots

| Slot Name | Description | |----------------|--------------------------| | default | Text inside cta | | before-icon | Icon SVG before the text | | after-icon | Icon SVG after the text | | loading-icon | Loading icon svg |

CSS variables

| Name | default | Description | |:----------------------------------------|:--------------|:--------------------------------------------------------------| | --cta-button-display | inline-flex | Value of the display property. Should be flex or inline-flex. | | --cta-button-align-items | center | Value of the align-items property. | | --cta-button-justify-content | center | Value of the justify-content property. | | --cta-button-width | auto | Cta width. | | --cta-button-height | auto | Cta height. | | --cta-button-padding | 1.5rem 3rem | Cta padding. | | --cta-button-border-width | 1px | Border width. | | --cta-button-border-style | solid | Border style. | | --cta-button-border-color | navy | Border color. | | --cta-button-border-radius | 0 | Cta border-radius. | | --cta-button-bg-color | navy | Cta background-color. | | --cta-button-box-shadow | none | Cta box-shadow. | | --cta-button-color | white | Cta color. | | --cta-button-font-weight | inherit | Cta font-weight. | | --cta-button-font-size | inherit | Cta font-size. | | --cta-button-line-height | normal | Cta line-height. | | --cta-button-font-family | inherit | Cta font-family. | | --cta-button-text-decoration | none | Cta text-decoration. | | --cta-button-cursor | pointer | Cta cursor. | | --cta-button-opacity | 1 | Cta opacity. | | --cta-button-disabled-border-width | 1 | Border width when the cta is disabled. | | --cta-button-disabled-border-style | solid | Border style when the cta is disabled. | | --cta-button-disabled-border-color | navy | Border color when the cta is disabled. | | --cta-button-disabled-bg-color | navy | Background-color when the cta is disabled. | | --cta-button-disabled-box-shadow | none | Box-shadow when the cta is disabled. | | --cta-button-disabled-color | #000000 | Color when the cta is disabled. | | --cta-button-disabled-text-decoration | white | Text-decoration when the cta is disabled. | | --cta-button-disabled-cursor | not-allowed | Cursor when the cta is disabled. | | --cta-button-disabled-opacity | 0.333 | Opacity when the cta is disabled. | | --cta-button-hover-border-width | 1 | Border width when the cta is in hover status. | | --cta-button-hover-border-style | solid | Border style when the cta is in hover status. | | --cta-button-hover-border-color | navy | Border color when the cta is in hover status. | | --cta-button-hover-bg-color | navy | Background-color when the cta is in hover status. | | --cta-button-hover-box-shadow | none | Box-shadow when the cta is in hover status. | | --cta-button-hover-color | white | Color when the cta is in hover status. | | --cta-button-hover-text-decoration | none | Text-decoration when the cta is in hover status. | | --cta-button-hover-opacity | 1 | Opacity when the cta is in hover status. | | --cta-button-icon-width | 24px | Icon width. | | --cta-button-icon-height | 24px | Icon height. | | --cta-button-icon-distance | 10px | Distance between the icon end the text inside the cta. | | --cta-button-icon-overflow | hidden | Icon overflow. | | --cta-button-icon-border-radius | 0 | Icon border-radius. | | --cta-button-icon-bg-color | transparent | Icon background-color. | | --cta-button-text-width | auto | Text width. | | --cta-button-text-align | center | Text align. |

CSS theme classes

| Name | Description | |:-------------|:------------------------------------------------------------------------------------------------------------------| | .btn-block | If present on the component instance the cta take all the space available inside the container where is rendered. |

Usage/Examples

<cta-button-cmp
  id="CtaButtonCmp-1"
  data-aria-label="Click me"
  class="primary"
  data-tag="button"
  data-type="button"
>
  CLICK ME
</cta-button-cmp>

Screenshots

Component Screenshot