slash-kit

PreviousNext
Docs
platecomponent

Preview

Loading preview…
registry/components/editor/plugins/slash-kit.tsx
'use client';

import { SlashInputPlugin, SlashPlugin } from '@platejs/slash-command/react';
import { KEYS } from 'platejs';

import { SlashInputElement } from '@/registry/ui/slash-node';

export const SlashKit = [
  SlashPlugin.configure({
    options: {
      triggerQuery: (editor) =>
        !editor.api.some({
          match: { type: editor.getType(KEYS.codeBlock) },
        }),
    },
  }),
  SlashInputPlugin.withComponent(SlashInputElement),
];

Installation

npx shadcn@latest add @plate/slash-kit

Usage

import { SlashKit } from "@/components/slash-kit"
<SlashKit />