Highlight Leaf

PreviousNext

A text highlighter with customizable colors.

Preview

Loading preview…
registry/ui/highlight-node.tsx
'use client';

import * as React from 'react';

import type { PlateLeafProps } from 'platejs/react';

import { PlateLeaf } from 'platejs/react';

export function HighlightLeaf(props: PlateLeafProps) {
  return (
    <PlateLeaf {...props} as="mark" className="bg-highlight/30 text-inherit">
      {props.children}
    </PlateLeaf>
  );
}

Installation

npx shadcn@latest add @plate/highlight-node

Usage

import { HighlightNode } from "@/components/ui/highlight-node"
<HighlightNode />