# @rmwc/fab

> RMWC Floating Action Button component

Latest version **14.3.5** (published 2024-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rmwc/fab
pnpm add @rmwc/fab
yarn add @rmwc/fab
bun add @rmwc/fab
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 14.3.5 |
| Published | 2024-10-24 |
| First published | 2018-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1657 |
| Author | rmwc |
| Maintainers | jamesmfriedman |
| Keywords | rmwc |

## Links

- npm: https://www.npmjs.com/package/@rmwc/fab
- Repository: https://github.com/rmwc/rmwc
- Homepage: https://github.com/rmwc/rmwc/tree/master/packages/fab
- Issues: https://github.com/rmwc/rmwc/issues
- npm.io page: https://npm.io/package/@rmwc/fab

## Dependencies (6)

- [@rmwc/base](https://npm.io/package/@rmwc/base.md) 14.3.5
- [@rmwc/icon](https://npm.io/package/@rmwc/icon.md) 14.3.5
- [@rmwc/types](https://npm.io/package/@rmwc/types.md) 14.3.5
- [@rmwc/ripple](https://npm.io/package/@rmwc/ripple.md) 14.3.5
- [@material/fab](https://npm.io/package/@material/fab.md) ^14.0.0
- [@rmwc/provider](https://npm.io/package/@rmwc/provider.md) 14.3.5

## Recent versions

- 14.3.5 (latest) — 2024-10-24
- 14.0.2-alpha.7 (next) — 2023-10-30
- 14.3.4 — 2024-09-25
- 14.3.3 — 2024-08-30
- 14.3.2 — 2024-08-19
- 14.3.1 — 2024-07-19
- 14.3.0 — 2024-07-18
- 14.2.9 — 2024-07-03
- 14.2.8 — 2024-07-01
- 14.2.7 — 2024-06-30
- 14.2.6 — 2024-06-28
- 14.2.5 — 2024-06-26
- 14.2.2 — 2024-04-24
- 14.2.1 — 2024-04-17
- 14.2.0 — 2024-04-17
- … 160 more at https://npm.io/package/@rmwc/fab/versions

## README

# Fabs

A floating action button (FAB) represents the primary action of a screen.

- Module **@rmwc/fab**
- Import styles:
  - Using CSS Loader
    - import '@rmwc/fab/styles';
  - Or include stylesheets
    - **'@material/fab/dist/mdc.fab.css'**
    - **'@rmwc/icon/icon.css'**
    - **'@material/ripple/dist/mdc.ripple.css'**
- MDC Docs: [https://material.io/develop/web/components/buttons/floating-action-buttons/](https://material.io/develop/web/components/buttons/floating-action-buttons/)

```jsx
<Fab icon="favorite" />
```

```jsx
<Fab icon="favorite" mini />
```

```jsx
<>
  <Fab icon="add" label="Create" />
  <Fab trailingIcon="add" label="Create" />
  <Fab label="Label only" />
</>
```

```jsx
<>
  <Fab icon="favorite_outline" theme={['primaryBg', 'onPrimary']} />
  <Fab
    icon="delete"
    style={{ backgroundColor: 'var(--mdc-theme-error)' }}
    theme={['onError']}
  />
</>
```

## Fab
A floating action button component

### Props

| Name | Type | Description |
|------|------|-------------|
| `children` | `ReactNode` | Content specified as children. |
| `exited` | `boolean` | Animates the FAB out of view. When this class is removed, the FAB will return to view. |
| `icon` | `IconPropT` | The icon for the FAB |
| `label` | `any` | Make the Fab extended with a label. |
| `mini` | `boolean` | Make the Fab smaller. |
| `ripple` | `RipplePropT` | Adds a ripple effect to the component |
| `trailingIcon` | `IconPropT` | A trialing icon for the FAB |

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