# ink-link

> Link component for Ink

Latest version **5.0.0** (published 2025-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install ink-link
pnpm add ink-link
yarn add ink-link
bun add ink-link
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2025-09-13 |
| First published | 2018-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 192 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | ink-component, ink, component, link, hyperlink, url, react, jsx, terminal, term, console, command-line |

## Links

- npm: https://www.npmjs.com/package/ink-link
- Repository: https://github.com/sindresorhus/ink-link
- Homepage: https://github.com/sindresorhus/ink-link#readme
- Issues: https://github.com/sindresorhus/ink-link/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/ink-link

## Dependencies (1)

- [terminal-link](https://npm.io/package/terminal-link.md) ^5.0.0

## 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

- 5.0.0 (latest) — 2025-09-13
- 4.1.0 — 2024-07-03
- 4.0.0 — 2024-05-31
- 3.0.0 — 2023-06-10
- 2.0.1 — 2022-12-23
- 2.0.0 — 2020-08-10
- 1.1.0 — 2020-04-06
- 1.0.0 — 2019-03-07
- 0.2.0 — 2018-04-04
- 0.1.0 — 2018-03-30

## README

# ink-link

> Link component for [Ink](https://github.com/vadimdemedes/ink)

Creates clickable links in the terminal!

<img src="screenshot.png" width="332">

## Install

```sh
npm install ink-link
```

## Usage

```js
import React from 'react';
import {render, Text} from 'ink';
import Link from 'ink-link';

render(
	<Link url="https://sindresorhus.com">
		My <Text color="cyan">Website</Text>
	</Link>
);
```

## API

### `<Link>`

[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)

For unsupported terminals, the link will be printed after the text: `My website https://sindresorhus.com`.

#### url

Type: `string`

The URL to link to.

#### fallback

Type: `boolean | (text: string, url: string) => string`\
Default: `true`

Determines whether the URL should be printed after the text for unsupported terminals: `My website https://sindresorhus.com`.

Can also be a function that receives the text and URL and returns a custom fallback string.

```js
<Link url="https://sindresorhus.com" fallback={(text, url) => `[${text}](${url})`}>
	My Website
</Link>
```

## Related

- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
- [ink-gradient](https://github.com/sindresorhus/ink-gradient) - Gradient color component for Ink
- [ink-big-text](https://github.com/sindresorhus/ink-big-text) - Awesome text component for Ink

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