Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rtcamp/gb-components

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rtcamp/gb-components

Components for gutenberg blocks

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
6
Weekly downloads
 
Created
Source

Gutenberg Block Components

A collection of handy custom built components for Gutenberg block development.

Important ⚠️☠️

This package is in early development stages. Please do not use it in production.

Components

NameAbout
AccordionSimple Accordion components.
gifAllows to embed gif
MapAllows to embed GoogleMap

and many more...

Installing

npm install @rtcamp/gb-components

How to use?

Import the component you want to use as follows:
/**
 * External dependencies
 */
import { Accordion } from "gutenberg-block-components";
Define required attributes:
	/**
	 * Block attributes.
	 *
	 * @type {Object}
	 */
	attributes: {
		accordion: {
			type: 'array',
			default: [],
		},
		accordionTitleTag: {
			type: 'string',
			default: 'h3',
		},
	},

Each component may have different attribute requirements.

Use the desired component in edit method as follows:
	/**
	 * Creates editor block.
	 *
	 * @param {Object} props Edit props.
	 *
	 * @return {*}
	 */
	edit( props ) {
		return <Accordion { ...props } />;
	},

Here we are passing the block props to the component.

The save method:
	/**
	 * Save
	 *
	 * @param {Object} props Save props.
	 *
	 * @return {*}
	 */
	save( props ) {
		return <Accordion.Content { ...props } />;
	},

For example for the accordion block,

@import "node_modules/@rtcamp/gb-components/styles/accordion/editor";

Finally register the block using registerBlockType().

Keywords

FAQs

Package last updated on 24 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc