### Spoiler Plugin

The Spoiler plugin lets users hide content behind a reveal button. It works on both text (via the formatting toolbar) and plugin blocks (images, galleries, videos — via the plugin settings modal).

#### Editor

```tsx widget
import {
  fromPlainText,
  pluginImage,
  pluginSpoiler,
  pluginVideo,
  RicosEditor,
} from '@wix/ricos';
import React from 'react';

export default () => (
  // @essential-start
  <RicosEditor
    initialContent={fromPlainText('Add content and mark it as a spoiler!')}
    plugins={[pluginSpoiler(), pluginImage(), pluginVideo()]}
  />
  // @essential-end
);
```

#### Viewer

```tsx widget
import '@wix/ricos/css/plugin-spoiler-viewer.global.css';
import '@wix/ricos/css/ricos-viewer.global.css';
import { pluginSpoilerViewer, type RicosDocument, RicosViewer } from '@wix/ricos';
import React from 'react';

export default () => {
  // @essential-start
  return <RicosViewer content={content} plugins={[pluginSpoilerViewer()]} />;
  // @essential-end
};

const content = {
  nodes: [
    {
      type: 'PARAGRAPH',
      id: 'axdjn4',
      nodes: [
        {
          type: 'TEXT',
          id: '',
          textData: {
            text: 'Spoiler',
            decorations: [
              {
                type: 'SPOILER',
              },
              {
                type: 'COLOR',
                colorData: {},
              },
            ],
          },
        },
      ],
    },
  ],
} as RicosDocument;
```
