Block Library
Block Library provides shared typed block primitives and registration contracts for Capell packages.
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.
Install on your Capell site in three steps.
Each extension ships as a standard Composer package. Purchases unlock account access immediately before you install.
-
01
Require the package
composer require capell-app/block-library -
02
Register the extension
php artisan capell:extension:enable capell-app-block-library -
03
Clear schema cache
php artisan capell:admin:clear-schemas-cache
Related extensions
Browse the packages that usually pair with Block Library or buy the suite it belongs to.
Blog
Publish articles, archives, tag pages, and related-article widgets with multilingual, multi-site output and op...
Campaign Studio
Launch, target, and measure marketing campaigns inside Capell — build landing-page variants, drop in CTA and l...
Editorial Foundation Suite
Start a Capell site with Layout Builder, reusable blocks, Foundation Theme, navigation, Media Library, and blog publishing in one free content launch path.
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
BlockVariantDataandBlockVariantKeyslug 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
PublicBlockViewReferenceandAdminPreviewBlockViewReference; - 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-libraryafter 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.jsonpromotes 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.
Downloads and releases
- Total downloads
- 0
- Last downloaded
- No downloads yet
Version history
1 release-
v1.0.0May 3, 2026
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.