Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@leafygreen-ui/button

Package Overview
Dependencies
Maintainers
3
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/button

leafyGreen UI Kit Button

  • 2.3.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by54.1%
Maintainers
3
Weekly downloads
 
Created
Source

Button

npm (scoped)

Example

import Button from '@leafygreen-ui/button';

<Button
  variant='primary'
  className='create-item-button'
  title='Create an item'
  onClick={(event) => {/* Something to handle the click event */}}
>
  Submit
</Button>

Output HTML

  <button class="css-1rgbgdt create-item-button" title="Create an item" disabled="false">
    Submit
  </button>

Properties

variant

Type: string

Default: 'default'

Sets the style variant of the button. Valid variants for buttons are 'default', 'primary', 'info', 'danger', and 'dark'.

size

Type: string

Default: 'normal'

Sets the size variant of the button. Valid variants for buttons are 'xsmall', 'small', 'normal', and 'large'.

onClick

Type: function

Default: () => {}

The event handler function for the 'onclick' event. Receives the associated event object as the first argument.

className

Type: string

Default: ''

Adds a className to the class attribute.

children

Type: node

Default: null

The children of the rendered <button> element.

value

Type: string

Default: null

Sets the HTML value attribute.

disabled

Type: boolean

Default: false

Disables the button.

as

Type: HTML Tag or React Element

Default: button

Determines the root element. For example, Link or a tags can be supplied to replace button from being the DOM element that wraps the component.

href

Type: string

Default: null

If a href is supplied it willl change the as value, such that the component renders inside of an a tag instead of inside of a button tag.

Any other properties will be spread on the input element.

Note: In order to make this Component act as a submit button, the recommended approach is to pass submit as the type prop. Note it is also valid to pass input to the as prop, and the button's content's to the value prop -- in this case, do not supply children to the component.

FAQs

Package last updated on 06 Aug 2019

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