@artibox/slate-blockquote
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@artibox/slate-blockquote

Slate blockquote.

npm package npm downloads

Installation

npm install @artibox/slate-blockquote --save

or

$ yarn add @artibox/slate-blockquote

Usage

Editor

import React from 'react';
import { Blockquote as BlockquoteIcon } from '@artibox/icons';
import { createArtiboxEditor } from '@artibox/slate-editor';
import { Toolbar } from '@artibox/slate-toolbar';
import { createBlockquote } from '@artibox/slate-blockquote';

const Blockquote = createBlockquote();

const plugins = [
  Blockquote.forPlugin(),
  Toolbar.forPlugin({
    collapsedTools: [{ icon: BlockquoteIcon, hook: Blockquote.forToolHook() }]
  })
];

const Editor = createArtiboxEditor({
  plugins
});

export default Editor;

Jsx Serializer

import { createJsxSerializer } from '@artibox/slate-jsx-serializer';
import { createBlockquoteJsxSerializerRule } from '@artibox/slate-blockquote';

const jsxSerializer = createJsxSerializer({
  blocks: [
    createBlockquoteJsxSerializerRule()
  ]
});

...

return (
  <div>
    {jsxSerializer(valueJSON /* from slate */)}
  </div>
);

API

Hotkey

OS Shortcut
Apple Logo ctrl+opt</kbd+q
Windows Logo ctrl+alt</kbd+q

Readme

Keywords

none

Package Sidebar

Install

npm i @artibox/slate-blockquote

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

37.3 kB

Total Files

40

Last publish

Collaborators

  • fantasywind