# react-and

> A lightweight React component for joining multiple components in a grammatically correct way.

Latest version **2.0.1** (published 2025-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-and
pnpm add react-and
yarn add react-and
bun add react-and
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2025-12-10 |
| First published | 2020-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | 24.x |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Luke Hansford |
| Maintainers | lukehansford |
| Keywords | react, grammar, conjunctions |

## Links

- npm: https://www.npmjs.com/package/react-and
- Homepage: https://github.com/lhansford/react-and
- Issues: https://github.com/lhansford/react-and/issues
- npm.io page: https://npm.io/package/react-and

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2025-12-10
- 2.0.0 — 2025-12-08
- 1.0.2 — 2022-08-17
- 1.0.1 — 2022-08-17
- 1.0.0 — 2020-08-19
- 1.0.0-rc.1 — 2020-08-05

## README

# react-and

![CI](https://github.com/lhansford/react-and/workflows/CI/badge.svg)
![npm](https://img.shields.io/npm/v/react-and?style=flat-square)
![NPM Size](https://img.shields.io/bundlephobia/min/react-and?style=flat-square)

A lightweight React component for joining multiple components in a grammatically correct way. Joins
components using commas, "and", "&", "or", or any other term you specify.

Written in Typscript with zero dependencies.

## Installation

```sh
yarn add react-and
npm install --save react-and
```

## Usage

ReactAnd accepts any number of children and will render them with the correct grammar.

```JSX
<ReactAnd>
  {[
    'apples',
    'oranges',
    'bananas',
  ]}
</ReactAnd>
```

Renders as:
> apples, oranges, and bananas

You can pass any valid React components as children:

```JSX
<ReactAnd>
  <a href="/apples">apples</a>
  <a href="/oranges">oranges</a>
</ReactAnd>
```

Renders as:
> `<a href="/apples>apples</a> and <a href="/oranges">oranges</a>`

## Props

### `conjuction`

This is the string to be used to join the last child when there is more than one child. Default: `"and"`.

```JSX
<ReactAnd conjuction="and/or">
  {[
    'apples',
    'oranges',
  ]}
</ReactAnd>
```

Renders as:
> apples and/or oranges

### `oxfordComma`

Determines whether an [Oxford comma](https://en.wikipedia.org/wiki/Serial_comma) will be used when joining the items. Default: `true`.

```JSX
<ReactAnd oxfordComma={false}>
  {[
    'apples',
    'oranges',
    'bananas',
  ]}
</ReactAnd>
```

Renders as:
> apples, oranges and bananas

## Demo

[https://lhansford.github.io/react-and/](https://lhansford.github.io/react-and/)

## License

Licensed under MIT.

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