# @cruise-automation/button

> Cruise button

Latest version **0.0.7** (published 2018-12-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @cruise-automation/button
pnpm add @cruise-automation/button
yarn add @cruise-automation/button
bun add @cruise-automation/button
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2018-12-28 |
| First published | 2018-12-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 54.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | janpaul123 |

## Links

- npm: https://www.npmjs.com/package/@cruise-automation/button
- npm.io page: https://npm.io/package/@cruise-automation/button

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [styled-components](https://npm.io/package/styled-components.md) ^3.3.0

## Recent versions

- 0.0.7 (latest) — 2018-12-28

## README

# @cruise-automation/button

Low level button component that supports Bulma styles. For usage across Cruise projects.

## Usage

Install: `npm install --save @cruise-automation/button`.

If the button is passed an `onClick` callback the event will have its propagation stopped before the callback is called. This is because 95% of the time you don't want the event to propagate and can be the source of subtle bugs. If you want the click to propagate, do not supply an `onClick` handler and wrap the component in a container element with an `onClick` handler such as a span or div.

## Props

| Name               | Type                       | Description                                                                                                                                       |
| ------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| children           | any                        | passed as the child(ren) to the `<button>` element                                                                                                |
| onClick?           | (e) => void                | click callback. The event will _not_ propagate to parent elements.                                                                                |
| primary?           | boolean                    | true to apply the `is-primary` class                                                                                                              |
| danger?            | boolean                    | true to apply the `is-danger` class                                                                                                               |
| small?             | boolean                    | true to apply the `is-small` class                                                                                                                |
| large?             | boolean                    | true to apply the `is-large` class                                                                                                                |
| primary?           | boolean                    | true to apply the `is-primary` class                                                                                                              |
| warning?           | boolean                    | true to apply the `is-warning` class                                                                                                              |
| danger?            | boolean                    | true to apply the `is-danger` class                                                                                                               |
| style?             | object                     | custom style to be applied as the `style={}` prop to the element                                                                                  |
| className?         | string                     | will be appended as a custom value to the `className=` prop                                                                                       |
| tooltip?           | string                     | will be set as the `title=` prop on the element                                                                                                   |
| delay?             | number                     | if supplied, onClick will not be called until after `delay` milliseconds have passed. A progress bar will be displayed while the button 'charges' |
| progressClassName? | string                     | optional additional css class to apply to the progress bar                                                                                        |
| progressStyle?     | { [string]: any }          | optional style properties to apply to the progress bar's style prop                                                                               |
| progressDirection? | "vertical" or "horizontal" | by default the value is "vertical", supply "horizontal" to grow the progress bar left-to-right instead of bottom-to-top                           |

---
_Source: https://npm.io/package/@cruise-automation/button · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
