New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lightspeed/cirrus-button

Package Overview
Dependencies
Maintainers
7
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lightspeed/cirrus-button

Cirrus Button Component

  • 11.0.0-alpha.1
  • npm
  • Socket score

Version published
Weekly downloads
96
decreased by-10.28%
Maintainers
7
Weekly downloads
 
Created
Source

Button

The most essential element of a user interface.


Sizes

Our buttons come in four different sizes: Small, Medium, Large & Extra Large. All buttons have a fixed height and padding unless stated differently inside the type

SizeUsage
smallThese little buttons are used in compact little spaces, e.g. inside the header of a card.
mediumDefault size of the Button
largeThe large button is mainly used inside an open but content-rich page with multiple actions. This large button also provides a large touchable area for use on touch screens.
xlargeWhen a single page has nothing going on but to promote a single thing with just one button, you should use the extra large button. This button is also great for fast pacing flows with a focus on touch screens.

Styles

These are all the styles that are included in all button types (unless stated differently in the types section).

StyleUsage
default/neutralThe neutral button is used for all generic actions.
primaryThere should only be one main action on the page. This action should always be a primary styled button.
secondaryFor subsequent actions that encourage our users to fill data like selecting a product.
dangerFor all actions that can be destructive, we use the danger styled button.

Types

These are all the styles that are included in all button types (unless stated differently in the types section).

TypeUsage
OutlineOur standard button is for all non-default styles the outline button can transform into a fill button to start encouraging interaction.
FillWhen taking action is promoted/encouraged we use the fill button. The main CTA should always be a fill. Not available in default style.
Icon + TextBringing visual context to what a button will do, can help the user understand and it manages expectations. When space is limited, but actions are required you might want to use an icon only button.
IconA small, often square-shaped button with only an <Icon> for CTA. These should be avoided at all costs, unless when dealing with extremely standard usecases. Consider an Icon + Text button instead.

Installation

First, make sure you have been through the Getting Started steps of adding Cirrus in your application.

If using Yarn:

yarn add @lightspeed/cirrus-button

Or using npm:

npm i -S @lightspeed/cirrus-button

React Component

Props
PropTypeDescription
childrenReact.ReactNodeThe content to display inside the button
fillbooleanDisplays as fill button
sizeenum['small', 'large', 'xlarge']Sets the size of the button
variantenum['primary', 'secondary', 'danger', 'default', 'neutral']Sets the color variant of the button
blockbooleanDisplays the button in full width
noSpacingbooleanRemove default spacing between button children
disabledbooleanDisables the button
loadingbooleanDisplays the loading icon and disables the button
hrefstringCreates a <a> link instead of a <button>
onClickfunctionCallback when button is clicked
onFocusfunctionCallback when button is focused
onBlurfunctionCallback when button is blurred
html propertystringAny extra properties will be added onto the button
Example
import React from 'react';
import Button from '@lightspeed/cirrus-button';

const MyComponent = () => (
  <div>
    <Button>My Button</Button>
  </div>
);

export default MyComponent;

FAQs

Package last updated on 29 Nov 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc