Skip to main content

Capell uses essential storage for sessions, security, and interface preferences. Analytics and marketing storage stay off unless you accept them.

Cookie Policy
Block Library marketplace hero artwork.

Block Library

Block Library provides shared typed block primitives and registration contracts for Capell packages.

Overview

What Block Library provides

Block Library provides shared typed block primitives and registration contracts for Capell packages.

It helps teams standardise reusable page sections without hard-coding one-off layout fragments into themes.

Editors get consistent content structures, while developers get explicit block definitions that are easier to test and evolve.

The package is strongest when multiple packages need to contribute blocks to the same page-building surface.

Use it as the shared foundation for maintainable, package-owned content sections.

/ 10
10 captures Visual gallery
Install

Install on your Capell site in three steps.

Each extension ships as a standard Composer package. Purchases unlock account access immediately before you install.

Support
First-party Capell support for active marketplace customers.
Data access
Reads and writes Capell content structures required by the package; public output receives rendered content only.
  1. 01

    Require the package

    composer require capell-app/block-library
  2. 02

    Register the extension

    php artisan capell:extension:enable capell-app-block-library
  3. 03

    Clear schema cache

    php artisan capell:admin:clear-schemas-cache
Works well with this

Related extensions

Browse the packages that usually pair with Block Library or buy the suite it belongs to.

Included in suites
Content launch

Editorial Foundation Suite

$0.00

Start a Capell site with Layout Builder, reusable blocks, Foundation Theme, navigation, Media Library, and blog publishing in one free content launch path.

Layout Builder Block Library Foundation Theme Navigation Media Library Blog
Package README Install impact, package shape, common pitfalls, and maintenance notes. Open

Capell Block Library

Block Library provides shared block primitives, foundation block views, screenshots, and Filament Builder block definitions that richer content-editing packages can register and render without reaching into each other's internals.

It owns the reusable public Blade blocks and the Builder block catalog, but it still does not own migrations, standalone admin resources, routes, or authoring markup.

The directory remains packages/block-library for workspace history, but the package identity is capell-app/block-library and the namespace is Capell\BlockLibrary\. Keep external references on the Composer name, not the folder name.

Start with Overview for install impact, surfaces, and screenshot coverage. Screenshot targets for consuming-package diagnostics live in docs/screenshots.json.

Why It Helps Your Capell Workflow

  • Gives content packages a shared typed block language and default renderable block catalog without coupling to each other.
  • Helps developers add reusable block definitions, variants, and renderer references behind one registry pattern.
  • Keeps public block rendering safe by separating trusted definitions from editor state, requests, and database-driven view names.

Best Used With

Docs

Current Surface

Surface Status
Namespace Capell\BlockLibrary\
Provider Capell\BlockLibrary\Providers\BlockLibraryServiceProvider
Commands None
Migrations None
Config None
Actions ListBlockDefinitionsAction, RegisterBlockDefinitionProviderAction, ResolveBlockDefinitionAction
Public extension points BlockDefinitionProvider::TAG, BlockRenderer, BlockRegistry, block fixtures and demo providers
Default blocks Hero, content, CTA, accordion, FAQ, features, stats, pricing, tabs, table, team, testimonial, and more
Tests Package manifest, registry, provider registration, action resolution, catalog rendering, screenshots

Registering Blocks

Packages register blocks by tagging a BlockDefinitionProvider implementation with BlockDefinitionProvider::TAG.

use Capell\BlockLibrary\Contracts\BlockDefinitionProvider;
use Capell\BlockLibrary\Data\BlockDefinitionData;

final class MarketingBlockProvider implements BlockDefinitionProvider
{
    public function definitions(): iterable
    {
        yield new BlockDefinitionData(
            key: 'marketing.hero',
            label: 'Marketing hero',
            description: 'A campaign-ready hero block.',
            category: 'marketing',
            view: 'vendor-package::blocks.marketing-hero',
            defaults: ['alignment' => 'center'],
        );
    }
}

Block views must render ordinary public HTML. Authoring metadata, selectors, model IDs, signed URLs, and editor scripts belong behind the authenticated frontend authoring beacon, not in block definitions or public output.

Block Definitions

BlockDefinitionData remains backwards compatible with the original key, label, description, category, view, and defaults shape. New packages can also provide:

  • per-block variants through BlockVariantData and BlockVariantKey slug value objects;
  • structured setting definitions with translated label/help keys, defaults, grouping, responsive fallbacks, and accessibility rules;
  • content and accessibility contracts for required fields, item limits, CTA rules, image ratios, alt/decorative-image intent, semantic rules, and keyboard expectations;
  • context-separated PublicBlockViewReference and AdminPreviewBlockViewReference;
  • class-string fixture/demo providers, screenshots, compatibility metadata, and source package metadata.

Public views are trusted PHP definitions only. Do not read view names from editor state, database meta, fixtures, or request data.

Registry Cache Safety

Registry manifests should contain structural metadata only. Localized labels/help text should be translation keys or resolved for the current admin locale at render time.

Compiled manifests must be written atomically and validated against currently installed packages, provider classes, fixture/demo provider classes, and trusted view contexts before use. If compilation fails and no valid manifest exists, callers should fall back to the safe built-in fallback definition and surface an admin/system health warning.

Testing

Run package tests from the repository root:

vendor/bin/pest packages/block-library/tests --configuration=phpunit.xml
Overview A shorter package overview for marketplace and account review. Open

Block Library

Status: Available, shared foundation · Kind: package · Tier: free · Bundle: foundation · Contexts: admin, frontend, shared · Product group: Capell Foundation

Block Library provides typed block definitions, reusable foundation block views, screenshots, renderer contracts, fixtures, demo-content contracts, and Filament Builder block discovery for packages that contribute reusable content blocks.

What This Package Adds

  • Block definition data objects and manifest metadata.
  • Registry actions for registering, listing, and resolving block definitions.
  • Contracts for block definition providers, renderers, fixtures, demo content, and Filament builder blocks.
  • Builder block discovery for classes implementing FilamentBuilderBlock.
  • Public Blade views and screenshots for the default block catalog.
  • A fallback block Blade view for unrenderable or unknown block output.

Install Flow

  • Composer package: capell-app/block-library
  • Repository directory: packages/block-library
  • Hard dependencies: capell-app/admin, capell-app/core
  • Optional dependencies: capell-app/content-sections, capell-app/foundation-theme
  • Run capell:extension-install capell-app/block-library after Composer install when validating package-installed guards.

Admin Surfaces

This package adds no standalone Filament navigation item, resource, page, widget, relation manager, or settings screen. Admin visibility appears through consuming packages that place the registered Filament Builder blocks into a Builder field.

Frontend Surfaces

This package adds no standalone public route. Frontend visibility appears through consuming packages that render registered block views and through the fallback block view when a block renderer cannot resolve a normal output view.

Screenshot Plan

  • Admin and frontend screenshots exist for every default catalog block in docs/screenshots/.
  • capell.json promotes the committed Capell runner captures for the registry list, editor form, asset settings, hero block, features block, and pricing block.
  • A Filament Builder block picker capture can still be added from a consuming admin Builder field as a future optional gallery item.
  • Fallback block rendering state should remain a controlled fixture capture when that fixture is added.

Known Risks

  • The package owns block screenshots but not a standalone preview route. Final captures still need a consuming harness or admin Builder field.

Feature Suggestions

  • Add a lightweight diagnostics command that lists registered block definitions, providers, renderers, and missing views.
  • Add a developer-facing preview page gated to admins that renders each registered block fixture from the registry.
  • Add schema validation output for block definitions so consuming packages can catch missing labels, categories, preview views, and accessibility metadata.
History

Downloads and releases

Total downloads
0
Last downloaded
No downloads yet

Version history

1 release
  1. v1.0.0
    May 3, 2026
Write a review

Write your comment here. If you are not logged in, you will be asked to log in or create an account before it can be submitted.

Login or create an account is required before the review is saved.

No approved reviews yet. Reviews from eligible customers appear here after marketplace review.

Payment and licences

How marketplace purchases work

Capell keeps payment, account ownership, package receipts, and install access separate so a failed step can be recovered without guessing where the licence lives.

Who takes the payment?

Paid marketplace checkouts are sent to Stripe. Capell does not collect card details inside your CMS; Stripe confirms the payment and Capell activates the matching marketplace licence for the Capell account that approved the install.

How is the licence attached?

The licence is created against the signed-in Capell account first. When the hosted install flow returns to your CMS, Capell binds that licence to the requesting site and sends back the install authorization needed to continue.

Where does Anystack fit?

Anystack can be the package commerce and distribution surface for marketplace products. Capell still records the account licence and installed receipt, then relays later Anystack product or licence events only to connected sites that already have the package installed.

What happens if checkout is cancelled or expires?

No licence is created until Stripe confirms payment. If checkout is cancelled, start it again from the same review screen. If the quote expires, return to the marketplace in your CMS and start a fresh install flow so pricing and package metadata are recalculated.

What should I do if something looks wrong?

Keep the support reference shown on the review screen or receipt, then contact support before retrying with a different account. For missing licences, failed returns, or Anystack receipt mismatches, Capell can reconcile the Stripe session, Capell account, package receipt, and connected site from that reference.