platejs

Link Element

Text 3

About

A Plate editor element that renders inline hyperlinks with primary-colored underline styling and hover states.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Link Element to your project and fits it to your theme.

Code

How Link Element is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { LinkElement } from "@/components/ui/link-node";

import * as React from "react";

import { LinkPlugin } from "@platejs/link/react";
import { Plate, PlateContent, usePlateEditor } from "platejs/react";

const initialValue = [
  {
    type: "p",
    children: [
      { text: "Visit " },
      {
        type: "a",
        url: "https://platejs.org",
        children: [{ text: "platejs.org" }],
      },
      { text: " to learn more about building rich-text editors." },
    ],
  },
];

export default function LinkDemo() {
  const editor = usePlateEditor({
    plugins: [
      LinkPlugin.configure({
        render: { node: LinkElement },
      }),
    ],
    value: initialValue,
  });

  return (
    <div className="w-full max-w-xl rounded-lg border p-4">
      <Plate editor={editor}>
        <PlateContent className="outline-none" />
      </Plate>
    </div>
  );
}

Dependencies

More by platejs

View all
  • Math Base Kit

    Math Base Kit

    15
  • Highlight Leaf

    Highlight Leaf

    6
  • Cursor Overlay

    Cursor Overlay

    5
  • Editor

    Editor

    4
  • Resize Handle

    Resize Handle

    3
  • Inline Combobox

    Inline Combobox

    1
  • List

    List

    1
  • Blockquote Element

    Blockquote Element

    1

More in Text

View all
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    103
  • Rainbow Text Effect

    Rainbow Text Effect

    47
  • Motion Blur Text

    Motion Blur Text

    36
  • Text Loop

    Text Loop

    310
  • Text Reveal

    Text Reveal

    27
  • Apple Hello Effect

    Apple Hello Effect

    610
  • Typography

    Typography

    4
  • Animated Text

    Animated Text

    8