# cf-component-link

> Cloudflare Link Component

Latest version **6.0.0** (published 2018-05-08) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install cf-component-link
pnpm add cf-component-link
yarn add cf-component-link
bun add cf-component-link
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2018-05-08 |
| First published | 2015-12-31 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 24.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Kyle |
| Maintainers | adamschwartz, cf-ci, cf-ci-write, ereeves, hamidagh, handrews, hturan, inikulin, jculvey, johndotawesome, jparyani-cloudflare, manatarms, marksteyn, miksu, mpint, nkcmr, rreverser, ryan0x44, sejoker, teffenellis, terinjokes, toekneestuck, vasturiano |

## Links

- npm: https://www.npmjs.com/package/cf-component-link
- npm.io page: https://npm.io/package/cf-component-link

## Dependencies (4)

- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0
- [cf-style-container](https://npm.io/package/cf-style-container.md) ^9.0.0
- [cf-util-route-handler](https://npm.io/package/cf-util-route-handler.md) ^4.2.5
- [cf-component-arrow-swivel](https://npm.io/package/cf-component-arrow-swivel.md) ^3.0.0

## Recent versions

- 6.0.0 (latest) — 2018-05-08
- 2.0.3 (stable) — 2016-02-05
- 5.1.36 — 2018-05-04
- 5.1.35 — 2018-05-02
- 5.1.34 — 2018-05-01
- 5.1.33 — 2018-04-27
- 5.1.32 — 2018-04-24
- 5.1.31 — 2018-04-24
- 5.1.30 — 2018-04-24
- 5.1.29 — 2018-04-20
- 5.1.28 — 2018-04-18
- 5.1.27 — 2018-04-12
- 5.1.26 — 2018-04-11
- 5.1.25 — 2018-03-28
- 5.1.24 — 2018-03-28
- … 45 more at https://npm.io/package/cf-component-link/versions

## README

# cf-component-link

> Cloudflare Link Component

## Installation
Installation with yarn is recommended

```sh

$ yarn add cf-component-link

```

## Usage

```jsx
import React from 'react';
import { Link } from 'cf-component-link';

class LinkComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isActive: false
    };
  }

  handleClick() {
    console.log('handleClick!');
  }

  handleExpandedClick() {
    this.setState({ isActive: !this.state.isActive });
  }

  render() {
    return (
      <div>
        <p>
          Create a <code>Link</code> with a <code>to</code> prop:
        </p>
        <Link to="/">Link to /</Link>

        <p>
          Alternatively you can pass an <code>onClick</code> handler:
        </p>
        <Link onClick={this.handleClick.bind(this)}>Link to something</Link>
        <p>{`Note: This will give it a role="button"`}</p>

        <p>
          All additional props will be added to the <code>Link</code> element:
        </p>
        <Link to="/foo">Link to /foo</Link>

        <p>You can create an expandable link by giving it an expandable prop</p>
        <Link
          onClick={this.handleExpandedClick.bind(this)}
          isActive={this.state.isActive}
          expandable
        >
          Link to /foo
        </Link>
      </div>
    );
  }
}

export default LinkComponent;

```

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