---
title: "Add a link popover UI component"
description: "Select link options in a popover element with this Tiptap UI component. More in our documentation"
---

> This page is for Tiptap 2.x. [See the latest version of this page.](https://tiptap.dev/docs/ui-components/components/link-popover.md)

# Add a link popover UI component

Select link options in a popover element with this Tiptap UI component. More in our documentation

> **Upgrade to v3**
>
> To use UI components or templates you need to upgrade to Editor version 3.x. See the [upgrade
> guide](https://tiptap.dev/docs/resources/whats-new) for more details.

A popover for creating and editing links.

> **Interactive demo:** [link popover](https://template.tiptap.dev/preview/tiptap-ui/link-popover)

## Install

You can add the component via Tiptap CLI (for Vite or Next.js)

```bash
npx @tiptap/cli add link-popover
```

### Manual Integration

For frameworks other than Vite or Next.js, add the component manually from the [open-source repository](https://github.com/ueberdosis/tiptap-ui-components/tree/main/apps/web/src/components/tiptap-ui/link-popover).

### Import styles

This component requires you to import our styles which were added to `styles/keyframe-animation.scss` and `styles/_variables.scss`.

## Usage

```tsx
import { EditorContent, EditorContext, useEditor } from '@tiptap/react'
import { StarterKit } from '@tiptap/starter-kit'
import { Link } from '@/components/tiptap-extension/link-extension'
import { LinkPopover } from '@/components/tiptap-ui/link-popover'

import '@/components/tiptap-node/paragraph-node/paragraph-node.scss'

export default function MyEditor() {
  const editor = useEditor({
    immediatelyRender: false,
    extensions: [StarterKit, Link.configure({ openOnClick: false })],
    content: `
        <p>Click the button to open the link popover.</p>
        <p><a href="https://www.tiptap.dev">Tiptap</a></p>
        `,
  })

  return (
    <EditorContext.Provider value={{ editor }}>
      <div className="tiptap-button-group" data-orientation="horizontal">
        <LinkPopover />
      </div>

      <EditorContent editor={editor} role="presentation" />
    </EditorContext.Provider>
  )
}
```

## Props

| Name                 | Type                      | Default | Description                                     |
| -------------------- | ------------------------- | ------- | ----------------------------------------------- |
| editor               | Editor \| null            | null    | The Tiptap editor instance                      |
| hideWhenUnavailable  | boolean                   | false   | Whether the popover is in a floating context    |
| onOpenChange         | (isOpen: boolean) => void | -       | Callback when popover open state changes        |
| autoOpenOnLinkActive | boolean                   | true    | Whether to open popover when a link is selected |

## Requirements

Used reference components

- `use-tiptap-editor` (hook)
- `tiptap-utils` (lib)
- `button` (primitive)
- `popover` (primitive)
- `separator` (primitive)
- `link-icon` (icon)
- `trash-icon` (icon)
- `corner-down-left-icon` (icon)
- `external-link-icon` (icon)

Open source feature(s)

- `@tiptap/extension-link`
