Search Highlight Leaf

PreviousNext

A component that highlights search results in text.

Preview

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

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

export function SearchHighlightLeaf(props: PlateLeafProps) {
  return <PlateLeaf {...props} className="bg-yellow-100" />;
}

Installation

npx shadcn@latest add @plate/search-highlight-node

Usage

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