Library of reusable components for easier WordPress block development. It includes tools for common tasks like media uploads, color settings, and layouts.
npm install @builtnorth/wp-component-library
A set of components for handling media uploads in different contexts.
Components:
ToolbarMediaUpload
: For use in block toolbarsEditorMediaUpload
: A customizable media upload buttonInspectorMediaUpload
: For use in inspector controls
Usage:
import { ToolbarMediaUpload, EditorMediaUpload, InspectorMediaUpload } from "@builtnorth/wp-component-library";
// Basic usage
<ToolbarMediaUpload
buttonTitle="Upload Image"
onSelect={handleImageSelect}
/>
<EditorMediaUpload
buttonTitle="Upload Image"
onSelect={handleImageSelect}
/>
<InspectorMediaUpload
buttonTitle="Upload Image"
onSelect={handleImageSelect}
/>
Components for managing section-level settings.
Components:
SectionSettings
: General section settingsSectionBackground
: Background settings for sections
Usage:
import { SectionSettings, SectionBackground } from "@builtnorth/wp-component-library";
// Basic usage
<SectionSettings
backgroundImage={backgroundImage}
handleImageSelect={handleImageSelect}
handleImageRemove={handleImageRemove}
/>
<SectionBackground
backgroundImage={backgroundImage}
/>
JS companion to wp_get_attachment()
. (From Brian Coords)
Usage:
import { AttachmentImage } from "@builtnorth/wp-component-library";
// Basic usage
<AttachmentImage imageId={imageId} alt={altText} size={size} />;
A component for displaying pagination.
Usage:
import { Pagination } from "@builtnorth/wp-component-library";
// Basic usage
<Pagination
currentPage={currentPage}
totalPages={totalPages}
onPageChange={handlePageChange}
/>;
This component library is provided "as is" without warranty of any kind, express or implied. Use at your own risk. The authors and contributors are not responsible for any damages or liabilities arising from the use of this library. Always test components thoroughly in your specific environment before deploying to production.