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

@visual-framework/vf-button

v3.0.1

Published

vf-button component

Downloads

2,265

Readme

Button component

npm version

About

Buttons are clickable elements that trigger an action. They can communicate calls to action, are visually prominent, and allow users to interact with the pages in various ways.

Usage

The vf-button component can be used with forms on a page and as a prominent 'call to action' link that goes to another page.

When To Use

A button can be used to submit data or take action and as a link to navigate to another page.

Use the primary button for the principal call to action on a page or form. Avoid having multiple primary buttons on the same page or form.

Use secondary buttons for secondary calls to action. Pages with too many prominent calls to action make it hard for users to know what to do next. Before adding lots of secondary buttons, try to simplify the page or break the content down across multiple pages.

Tertiary buttons can be used for less prominent actions. Consider using a link instead of a button to send users to another page, if this action is not very important.

As the vf-button is relatively large, depending on the context, you may wish to use the vf-button--small variant instead.

Alignment

As a general rule, the vf-button should be left aligned on the page and when used inside a larger component.

When used in conjunction with a single form input, as in the vf-search component, the vf-button needs to be inline with the input and to the right of it.

When a vf-button is used in a banner (e.g. to accept cookies) it needs to follow the content and be right aligned.

When Not To Use

If using the vf-button as a link do not use it to link to content on the same page. Use the vf-link-list component instead.

Label

Write button text in sentence case, describing the action it performs. For example:

  • ‘Apply now’ to apply for a job.
  • ‘Create account’ to create an account.
  • ‘Sign in’ to an account that a user has already created.
  • ‘Save and continue’ when pressing the button will save the information that the user has entered.

Try to keep the text on the button short and clear.

Related documentation

The guidelines on buttons in the GOV.UK Design System and the Carbon Design System include additional advice on when and how to use buttons.

Angular

Latest Angular package (3.0.0-alpha.0) was generated with Angular version 15.2.0 and has been tested on application with Angular version 15.2.0.

  1. install yarn add @visual-framework/vf-button
  2. import in your app.module
    import { VfButtonAngularModule } from '@visual-framework/vf-button/vf-button.angular';
    
    @NgModule({
      imports: [VfButtonAngularModule, YourOtherModules],
      ...
    })
  3. can be used as
    <vf-button [text]="'Primary Button'" [theme]="'primary'"></vf-button>
  4. add to your styles.scss
    @import '../node_modules/@visual-framework/vf-sass-config/index.scss';
    @import "../node_modules/@visual-framework/vf-button/vf-button.scss";
    (you should also make use of vf-sass-starter)

Depending on the success of this method, we plan to add standardized guidance to the component library and component generator.

Usage:

<vf-button [text]="'Primary Button'" [theme]="'primary'"></vf-button>

Install

This component is distributed with npm. After installing npm, you can install the vf-button with this command.

$ yarn add --dev @visual-framework/vf-button

Sass/CSS

The source files included are written in Sass(scss). You can point your Sass include-path at your node_modules directory and import it like this.

@import "@visual-framework/vf-button/index.scss";

Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter

Help