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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nds-assignment

v2.0.0

Published

Submit button component

Readme

Submit Button

A Submit button is a primary kind of button. Use it for either submitting or sending information on a form, or accepting terms on a prompted message.

Installation

To install and save it in your package.json dependencies, run the command below npm:

npm install nds-assignment

or, if you are using yarn:

yarn add nds-assignment

and then import the component into your project:

import * as React from 'react';
import ReactDOM from 'react-dom';
import { SubmitButton } from 'nds-assignment';

function App() {
  return <SubmitButton />;
}

Type modifiers

The submit button component comes in two different variants: Default and Inverted

Default

Use this button when the background is lighter (color-bg1, color-bg2, color-bg3 or light mode).

As its name states, this type will be provided by default so there is no need to specify the type.

<SubmitButton />

This will return a medium-sized default button

Inverted

Use this button when the background is darker than the content (dark mode).

To change the variant of the button, use the type attribute.

<SubmitButton type="inverted" />

Size modifiers

The submit button component comes in three different sizing options: small, medium and large.

Use them minding carefully both the size of your master component and the size of the viewport you are targeting.

The default size variant is medium

To change the size of the button, use the size attribute.

<SubmitButton size="small" />

or

<SubmitButton size="large" />

Use the small button for portrait views in small devices (mobile).

Use the large button for larger desktop screens.

Handling clicks

Use the onButtonClick handler to pass the function the button will trigger when pressed.

const myFunction = () => {
    console.log("Pressed");
}

...

<SubmitButton onButtonClick={myFunction} />

Disabling buttons

To disable the button just add the disabled attribute.

<SubmitButton disabled />

Correct usage

Never use more than one Submit button on the same view.

The submit button is a primary button that should trigger ONLY the desired action.

To add new actions use instead a secondary button or a plain text button.

do's and dont's

Placement

Place the button in the users’ reading pattern according to the flow of your form.

Vertical flow (Z-flow / F-flow)

Form following a vertical flow

Horizontal flow

Form following a horizontal flow

Accessibility

  • Use always the corresponding variant according to the background color in order to maintain a correct contrast ratio.

  • Use the adequate size according to the viewport you're targeting or the size of your master component to make it reachable.

  • Make sure the submit button is the last element on your tabulation order.