/component-scaffold

DEPRECATED. Please go to https://github.com/10up/component-library

Primary LanguageJavaScriptMIT LicenseMIT

10up Component Name

DEPRECATED. Please go to https://github.com/10up/component-library

NOTE: This is intended to be a boilerplate component. Clone this component, remove this comment, and use the rest as a starting point for your new component.

Support Level License: MIT Automated Tests

Component Description

Installation

NPM

npm install --save @10up/component-name

View official documentation for this package

Standalone

Clone this repo and import component.js and component.css from the dist/ directory.

API

Add API information here.

Callbacks

  • onCreate: Called after the component is initialized on page load

Usage

Markup

This is the markup template expected by the component.

<div class="component">
</div>

CSS

The styles can be imported into your existing codebase by using PostCSS imports, or by including the standalone CSS file in your project.

PostCSS Imports

@import '@10up/component-name';

Standalone

Include the component.css file from the dist/ directory.

JavaScript

Create a new instance by supplying the selector to use for the component and an object containing any necessary callback functions.

NPM

import TenUpScaffold from '@10up/tenup-scaffold';

TenUpScaffold( '.component', {
	onCreate: function() {
		console.log( 'onCreate callback' );
	}
} );

Demo

Example implementations can be found in the demo directory.

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Like what you see?

10up