@webiny/app-page-builder-elements
TypeScript icon, indicating that this package has built-in type declarations

5.39.5 • Public • Published

@webiny/app-page-builder-elements

code style: prettier PRs Welcome

A package that provides all the tools necessary to render pages created with Webiny's Page Builder application.

Table of Contents

Installation

npm install --save @webiny/app-page-builder-elements

Or if you prefer yarn:

yarn add @webiny/app-page-builder-elements

ℹ️ NOTE

In most cases, manual installation is not needed as the package is already included in every Webiny project.

Overview

A package that provides all the tools necessary to render pages created with Webiny's Page Builder application. It not only contains a set od default page element renderers (paragraph, heading, block, cell, grid, ...), but also the necessary utilities to create new ones.

Examples

Example Description
Manual Setup An example of manually setting up the PageElementsProvider, with all of the default renderers and modifiers. Useful when rendering pages in an external project, for example in a standalone Next.js application.

Reference

Components

PageElementsProvider

Type Declaration

export declare const PageElementsProvider: React.ComponentType<PageElementsProviderProps>;

Sets up all the page element renderers and modifiers. Must be mounted at the beginning of your React application.

import React from "react";
import { PageElementsProvider as PbPageElementsProvider } from "@webiny/app-page-builder-elements/PageElements";

// Import element renderers.
// ( ... )

// Import modifiers.
// ( ... )

// A theme object. For more info, see:
// https://github.com/webiny/webiny-js/tree/dev/packages/theme
import { theme } from "./theme";

interface PageElementsProviderProps {
  children: React.ReactNode;
}

export const PageElementsProvider = ({ children }: PageElementsProviderProps) => (
  <PbPageElementsProvider
    theme={theme}
    renderers={
      {
        /* ... */
      }
    }
    modifiers={{
      attributes: {
        /* ... */
      },
      styles: {
        /* ... */
      }
    }}
  >
    {children}
  </PbPageElementsProvider>
);

Readme

Keywords

none

Package Sidebar

Install

npm i @webiny/app-page-builder-elements

Weekly Downloads

587

Version

5.39.5

License

MIT

Unpacked Size

513 kB

Total Files

270

Last publish

Collaborators

  • webiny