# draft-js-toolbar-link-plugin

> This is a plugin for the `draft-js-plugins-editor`, basing on `draft-js-plugin-editor-toolbar-picker` and working together with `draft-js-static-toolbar-plugin`.

Latest version **1.0.1** (published 2017-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install draft-js-toolbar-link-plugin
pnpm add draft-js-toolbar-link-plugin
yarn add draft-js-toolbar-link-plugin
bun add draft-js-toolbar-link-plugin
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-10-05 |
| First published | 2017-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Loy B. |
| Maintainers | lonord |
| Keywords | react, draft, plugin, link, toolbar |

## Links

- npm: https://www.npmjs.com/package/draft-js-toolbar-link-plugin
- Repository: https://github.com/lonord/draft-js-toolbar-link-plugin
- Homepage: https://github.com/lonord/draft-js-toolbar-link-plugin#readme
- Issues: https://github.com/lonord/draft-js-toolbar-link-plugin/issues
- npm.io page: https://npm.io/package/draft-js-toolbar-link-plugin

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^3.0.1
- [styled-components](https://npm.io/package/styled-components.md) ^2.1.2
- [union-class-names](https://npm.io/package/union-class-names.md) ^1.0.0
- [decorate-component-with-props](https://npm.io/package/decorate-component-with-props.md) ^1.0.2
- [draft-js-plugin-editor-toolbar-picker](https://npm.io/package/draft-js-plugin-editor-toolbar-picker.md) ^0.1.5

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

- 1.0.1 (latest) — 2017-10-05
- 1.0.0 — 2017-09-30

## README

# draft-js-toolbar-link-plugin
This is a plugin for the `draft-js-plugins-editor`, basing on `draft-js-plugin-editor-toolbar-picker` and working together with `draft-js-static-toolbar-plugin`.

## Install

```bash
$ npm install draft-js-toolbar-link-plugin
```

## Usage

```js
import createToolbarLinkPlugin from 'draft-js-toolbar-link-plugin'

// Create plugin with an optional argument
const toolbarLinkPlugin = createToolbarLinkPlugin({
	/*
	Custom theme of input element
	inputTheme?: { wrapper: string, input: string }

	Custom placeholder text of input element
	inputPlaceholder?: string

	Custom theme of anchor element in link decorator
	linkTheme?: { anchor: string, anchorSelect: string }

	Target attrbute of anchor element, default value is `_blank`
	linkTarget?: string

	Custom input wrapper component, it does not take effect if `inputTheme` is set
	inputWrapperComponent?: React.Component

	Custom input component, it does not take effect if `inputTheme` is set
	inputComponent?: React.Component

	Custom anchor component, it does not take effect if `linkTheme` is set
	linkComponent?: React.Component
	*/
})
const { LinkButton } = toolbarLinkPlugin

// Use `LinkButton` in `draft-js-static-toolbar-plugin`
const toolbarPlugin = createToolbarPlugin({
	structure: [
		BoldButton,
		ItalicButton,
		UnderlineButton,
		CodeButton,
		LinkButton,   // Use `LinkButton` as an item button
		Separator,
		UnorderedListButton,
		OrderedListButton,
		BlockquoteButton,
		CodeBlockButton
	]
})
```

## License
MIT

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