sindresorhus/ink-link

Link component for Ink

192

stars

31

commits

TypeScript

primary language

Sep 13, 2025

updated

cli
ink
ink-component
jsx
nodejs
npm-package
react
Browse cluster: Ink CLI component library β†’

README

ink-link

Link component for Ink

Creates clickable links in the terminal!

Install

npm install ink-link

Usage

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

Supported terminals.

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.

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

Contributors

sindresorhus

26 commits

colinking

2 commits

euZebe

1 commits

gquittet

1 commits

sindresorhus/ink-link

Link component for Ink

192

stars

31

commits

TypeScript

primary language

Sep 13, 2025

updated

cli
ink
ink-component
jsx
nodejs
npm-package
react
Browse cluster: Ink CLI component library β†’

README

ink-link

Link component for Ink

Creates clickable links in the terminal!

Install

npm install ink-link

Usage

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

Supported terminals.

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.

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

Contributors

sindresorhus

26 commits

colinking

2 commits

euZebe

1 commits

gquittet

1 commits

Languages

TypeScript

100.0%