# @types/react-linkify

> TypeScript definitions for react-linkify

Latest version **1.0.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-linkify
pnpm add @types/react-linkify
yarn add @types/react-linkify
bun add @types/react-linkify
```

## Health

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

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-11-07 |
| First published | 2019-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51437 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-linkify
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-linkify
- npm.io page: https://npm.io/package/@types/react-linkify

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 1.0.4 (latest) — 2023-11-07
- 1.0.1 (ts3.6) — 2021-07-07
- 1.0.0 (ts3.4) — 2019-11-20
- 1.0.3 — 2023-10-18
- 1.0.2 — 2023-09-27
- 0.2.0 — 2019-04-04

## README

# Installation
> `npm install --save @types/react-linkify`

# Summary
This package contains type definitions for react-linkify (http://tasti.github.io/react-linkify/).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-linkify.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-linkify/index.d.ts)
````ts
import * as React from "react";

/**
 * Matching information
 */
export interface MatchInfo {
    /**
     * Link schema, can be empty for fuzzy links, or for protocol-neutral links
     */
    schema: string;
    /**
     * Offset of matched text
     */
    index: number;
    /**
     * Index of next char after the end of the matched text
     */
    lastIndex: number;
    /**
     * Normalized text
     */
    text: string;
    /**
     * Link, generated from matched text
     */
    url: string;
}

export interface Props {
    children: React.ReactNode;
    /**
     * Custom anchor tag creator
     * Default to using exisint <a> tag with the provided href={decoratedHref}, key={key}
     * and children={decoratedText}, without additional styling
     */
    componentDecorator?: ((decoratedHref: string, decoratedText: string, key: number) => React.ReactNode) | undefined;
    /**
     * Custom href decorator or mapper on the matched (url) href
     * Default to no transformation
     */
    hrefDecorator?: ((urlHref: string) => string) | undefined;
    /**
     * Custom matcher for (url), that returns each match with the matching information
     * Default to https://github.com/markdown-it/linkify-it's LinkifyIt().tlds(tlds).match
     */
    matchDecorator?: ((text: string) => MatchInfo[] | null) | undefined;
    /**
     * Custom text decorator or mapper on the matched (url) text
     * Default to no transformation
     */
    textDecorator?: ((urlText: string) => string) | undefined;
}

export default class ReactLinkify extends React.Component<Props> {}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Michael James](https://github.com/majames), [Jacky Wang](https://github.com/jackywang529), and [Akhil Stanislavose](https://github.com/akhilstanis).

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