--- url: /guide/introduction.md --- # Introduction **FilamentCraft** is a Shopify-style visual website builder for **Filament v4 and v5**. Drag-and-drop sections, a live iframe preview, revisioned templates, undo/redo, and multi-tenant support — all installed into your existing Filament panel. ::: tip Dual version support FilamentCraft dual-supports Filament 4 (with Livewire 3) and Filament 5 (with Livewire 4) from one codebase. Composer picks the right pair based on what your host app already has installed. See [Dual Version Support](/reference/dual-version). ::: ## Requirements * PHP 8.2+ * Laravel 11 or 12 * Filament 4.x or 5.x * Livewire 3.x or 4.x ## What you get out of the box * **Editor page** — left rail of section catalog + page sections, center iframe preview (desktop / tablet / mobile), right settings panel. * **12 built-in sections** — Header, Hero, Logo cloud, Features, Image with text, Stats, Testimonials, Pricing, FAQ, Rich text, CTA, Footer. Toggle all off with `->withBuiltinSections(false)` or hide specific section types with `->withoutSections([...])`. * **Live preview** — section-level refresh from the server's draft state (no full reload), debounced settings, undo/redo with a 50-step ring buffer, autosave-to-draft every keystroke. * **Revisions** — every Save creates a `template_revision` row; Publish promotes the head revision to the public-facing one. Discard rolls back to the published state. * **Public routing** — opt-in catch-all that serves published templates. Off by default; flip on when you want FilamentCraft to own the front-end. * **Multi-tenant** — sites can belong to any host model (`User`, `Workspace`, `Shop`, …) via a polymorphic `owner` morph. Resolves automatically against Filament's tenant. * **Homepage assignment** — set any template as the site's `/` from the editor topbar. ## How the pieces fit together | Concept | What it is | |---|---| | **Site** | A buildable website. Belongs to an owner model (for multi-tenant apps) and points at a Theme. | | **Theme** | A PHP class that declares the settings panel your end-users see — colors, typography, buttons, color schemes, etc. | | **Template** | A page within a Site (`home`, `pricing`, …). Has a status (draft / published) and a type. | | **Template Revision** | An immutable snapshot of a template's sections. Every Save writes one; Publish promotes one. | | **Region** | Shared areas (header / footer) rendered around every page and around custom dynamic pages. | | **Section** | A reusable block (Hero, Features, …) with a static settings schema and a Blade view. | ## Where to go next * [Installation](/guide/getting-started) — install via Anystack, register the plugin, build your first page. * [Sections](/guide/sections) — use the built-ins, write custom sections, curate the catalog. * [Theme Authoring](/guide/theme-authoring) — expose a full theme settings panel to your users. * [Tenancy](/guide/tenancy) — how the current Site is resolved at runtime. ## License Proprietary — see [filamentcraft.dev](https://filamentcraft.dev) for commercial tiers. Distributed via [Anystack](https://anystack.sh). --- --- url: /guide/getting-started.md --- # Installation FilamentCraft is distributed as a private Composer package through [Anystack](https://anystack.sh). You'll add the private repository and HTTP basic credentials, then `composer require` as usual. ## Install ```bash # Use the Composer repository URL and credentials shown in your Anystack license/account. composer config repositories.filamentcraft composer composer config http-basic. composer require filamentcraft/filamentcraft php artisan filamentcraft:install ``` Anystack private Composer packages require adding the private repository and HTTP basic credentials before `composer require`; the license key is used as the Composer password. The install command: * publishes the config + migrations and runs them, * registers editor assets via `filament:assets`, * creates the public storage symlink used by image uploads. ## Start with an example site To land on a working page right after install, pass `--example`: ```bash php artisan filamentcraft:install --example ``` That seeds a `studio` Theme, a `studio-demo` Site, and a published `home` template populated with Hero + Features + Footer sections. Re-running the command is idempotent — the second invocation prints `Example site already seeded` and exits cleanly. ## Register the plugin Register the plugin on the panel that should host the editor: ```php use FilamentCraft\FilamentCraftPlugin; public function panel(Panel $panel): Panel { return $panel ->id('admin') ->plugin(FilamentCraftPlugin::make()); } ``` That's it for the minimal install — open the panel and you'll find a **Templates** resource and an **Editor** page. ## Build your first page 1. Create a **Theme** and **Site** row (via the resources or a seeder). 2. Add a **Template** and click **Open in Editor**. 3. Add sections from the catalog, edit their settings, and watch the live preview update. 4. **Save** to write a draft revision, then **Publish** to promote it. ## Next steps * [Styling & Tailwind](/guide/styling) — wire FilamentCraft into your panel's Tailwind build. * [Sections](/guide/sections) — the built-in catalog and writing your own. * [The Editor](/guide/editor) — topbar actions, devices, focus mode, undo/redo. --- --- url: /guide/styling.md --- # Styling & Tailwind FilamentCraft ships compiled fallback CSS so the editor and the built-in sections are usable immediately after `php artisan filamentcraft:install`. For a real project, you should still use a Filament custom theme and let the host app compile the Tailwind classes used by this package and by your own sections. ## Why a custom theme Filament's default panel stylesheet only contains Filament's own UI classes. Any Tailwind utilities used in package views, custom pages, custom section Blade files, or section PHP classes must be visible to the host app's Tailwind build. ## 1. Create a panel theme Create a panel theme if the app does not already have one: ```bash php artisan make:filament-theme admin ``` ## 2. Register it on the panel ```php use Filament\Panel; public function panel(Panel $panel): Panel { return $panel // ... ->viteTheme('resources/css/filament/admin/theme.css') ->plugin(FilamentCraftPlugin::make()); } ``` ## 3. Add FilamentCraft (and your section) sources Add FilamentCraft and your own section sources to `resources/css/filament/admin/theme.css`: ```css @import '../../../../vendor/filament/filament/resources/css/theme.css'; @source '../../../../app/Filament/**/*'; @source '../../../../resources/views/filament/**/*'; /* FilamentCraft editor views, field views, and PHP classes that emit classes. */ @source '../../../../vendor/filamentcraft/filamentcraft/resources/views/**/*.blade.php'; @source '../../../../vendor/filamentcraft/filamentcraft/src/**/*.php'; /* Your host-app sections. */ @source '../../../../app/Sections/**/*.php'; @source '../../../../resources/views/sections/**/*.blade.php'; @custom-variant dark (&:where(.dark, .dark *)); ``` ## 4. Rebuild Rebuild after changing the source list: ```bash npm run build php artisan filament:assets ``` This follows Filament's plugin guidance: plugin views that use Tailwind should be included in the host custom theme with `@source`. FilamentCraft keeps its compiled CSS enabled as a fallback for quick installs and for users who have not created a custom theme yet. ::: info Preview & public-page styling The Filament panel theme styles the editor *chrome*. The iframe preview and public template output are **separate HTML documents** that need their own CSS. See [Preview & Public Assets](/reference/assets) for the three-tier asset model. ::: --- --- url: /guide/sections.md --- # Sections Sections are the reusable building blocks that make up a page — Hero, Features, Pricing, and so on. A page (template) is an ordered list of section instances, each with its own settings, blocks, and color scheme. FilamentCraft ships **12 built-in sections** and treats custom sections as a first-class citizen: a single PHP class plus a Blade view is all it takes to add your own. ## Start here | Page | What it covers | |---|---| | [Built-in Sections](/guide/built-in-sections) | All 12 shipped sections — their settings, blocks, and presets. | | [Custom Sections](/guide/custom-sections) | Author your own section, mix DSL + Filament components, add blocks and presets. | | [Curating the Catalog](/guide/curating-the-catalog) | Control which section types appear in the Add Section picker. | | [Setting Types](/guide/inputs/overview) | Every input you can put in a section's `settings()`. | ## Anatomy of a section * **Settings** — the controls shown in the section's panel, declared in a static `settings()` method. See [Setting Types](/guide/inputs/overview). * **Blocks** — repeatable child items (nav links, pricing plans, quotes) with their own settings and an optional limit. See [Custom Sections → Blocks](/guide/custom-sections#blocks). * **Presets** — named, one-click starting points bundling settings + blocks. See [Custom Sections → Presets](/guide/custom-sections#presets). * **A Blade (or Livewire) view** — renders the resolved data on the page. ## A custom section in 30 seconds ```php namespace App\Sections; use FilamentCraft\Sections\BladeSection; use FilamentCraft\Settings\Types\Text; use FilamentCraft\Settings\Types\Textarea; final class TestimonialSection extends BladeSection { protected static string $view = 'sections.testimonial'; public static function slug(): string { return 'testimonial'; } public static function name(): string { return 'Testimonial'; } public static function settings(): array { return [ Textarea::make('quote')->label('Quote')->required(), Text::make('author')->label('Author')->required(), ]; } public static function defaults(): array { return ['settings' => ['author' => 'Customer Name'], 'blocks' => []]; } } ``` Register it with `->registerSection(\App\Sections\TestimonialSection::class)` or drop it in `app/Sections/` for auto-discovery. The full walkthrough — the contract, blocks, presets, and extending a built-in — is in [Custom Sections](/guide/custom-sections). ::: tip Scaffold it `php artisan make:filamentcraft-section Testimonial` generates the class and Blade view (add `--livewire` for a Livewire section). See [Make Commands](/reference/commands). ::: --- --- url: /guide/built-in-sections.md --- # Built-in Sections FilamentCraft ships **12** built-in sections, registered automatically unless you opt out. Each is a `BladeSection` subclass under `FilamentCraft\Sections\Builtin` with a curated settings schema, optional repeatable **blocks**, and one or more ready-made **presets**. | # | Section | Slug | Icon | Blocks | |---|---|---|---|---| | 1 | Header | `header` | `heroicon-o-bars-3` | `nav-link` | | 2 | Hero | `hero` | `heroicon-o-sparkles` | `proof` (limit 4) | | 3 | Logo cloud | `logo-cloud` | `heroicon-o-building-office-2` | `logo` | | 4 | Features | `features` | `heroicon-o-squares-2x2` | `feature` | | 5 | Image with text | `image-text` | `heroicon-o-photo` | — | | 6 | Stats | `stats` | `heroicon-o-chart-bar` | `stat` | | 7 | Testimonials | `testimonials` | `heroicon-o-chat-bubble-left-right` | `quote` | | 8 | Pricing | `pricing` | `heroicon-o-credit-card` | `plan` | | 9 | FAQ | `faq` | `heroicon-o-question-mark-circle` | `item` | | 10 | Rich text | `rich-text` | `heroicon-o-document-text` | — | | 11 | CTA | `cta` | `heroicon-o-megaphone` | — | | 12 | Footer | `footer` | `heroicon-o-bars-3-bottom-left` | `link` | ::: info Where to find them The registration list lives in `FilamentCraftPlugin::BUILTIN_SECTIONS`; each class is in `src/Sections/Builtin/`. To hide or replace them, see [Curating the Catalog](/guide/curating-the-catalog). ::: ## Shared style enums Most sections expose the same four `EnumButtons` controls, backed by these enums (each implements `HasLabel`, `HasColor`, `HasIcon` and offers an `::options()` helper): | Enum | Setting | Cases | |---|---|---| | `SectionShape` | `shape` | `clean`, `contained`, `layered`, `wireframe` | | `SectionDensity` | `density` | `compact`, `comfortable`, `airy` | | `SectionAlignment` | `align` / `content_align` | `start`, `center` | | `MediaPlacement` | `media_mode` / `media_placement` | `none`, `background`, `start`, `end` | Every section also exposes a `ColorScheme::make('scheme')` control — see [Color Inputs](/guide/inputs/color#colorscheme). *** ## 1. Header A site header with brand, navigation links, an optional CTA, and a locale switcher. **Settings:** `brand_text` (Text), `brand_logo` (Image), `cta_enabled` (Toggle), `cta_label` (Text, shown when `cta_enabled`), `cta_url` (Link, shown when `cta_enabled`), `show_locale_switcher` (Toggle), `alignment` (Select: `split` / `centered` / `compact`), `sticky` (Toggle), `show_border` (Toggle), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Blocks:** `nav-link` — `label` (Text), `url` (Link). **Presets:** *Split Header*, *Centered Header*. ## 2. Hero The flagship section, and a live demonstration of the dual-input schema (DSL settings sit next to raw Filament components like `Toggle`, `ColorPicker`, and `TemplateUrlPicker`). **Settings:** `eyebrow`, `heading` (Text), `subheading` (Textarea), `cta_enabled` (Toggle), `cta_url` (TemplateUrlPicker — searches published templates), `cta_label` (Text), `supporting_text` (Text), `bg_image` (Image), `media_mode` (EnumButtons → `MediaPlacement`), `layout` (Select: `spotlight` / `editorial` / `compact`), `content_align` (EnumButtons → `SectionAlignment`), `density` (EnumButtons → `SectionDensity`), `shape` (EnumButtons → `SectionShape`), `scheme` (ColorScheme), `surface_style` (Select: `glass` / `solid` / `none`), `use_accent_override` (Toggle), `accent_color` (ColorPicker, shown when override is on). **Blocks:** `proof` (limit 4) — `value` (Text), `label` (Text). **Presets:** *SaaS Spotlight*, *Editorial Split*. ## 3. Logo cloud Social-proof logos in a grid or single row. **Settings:** `eyebrow`, `title` (Text), `intro` (Textarea), `layout` (Select: `grid` / `row`), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `tone` (Select: `mono` / `color`), `scheme` (ColorScheme). **Blocks:** `logo` — `name` (Text), `logo` (Image). **Presets:** *Partner Grid*. ## 4. Features A feature grid with configurable layout, column count, and per-card icon/proof. **Settings:** `eyebrow`, `title` (Text), `intro` (Textarea), `layout` (Select: `cards` / `bands` / `minimal`), `columns` (Select: `2` / `3` / `4`), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Blocks:** `feature` — `icon` (Icon), `eyebrow` (Text), `title` (Text), `description` (Textarea), `stat` (Text), `url` (Link). **Presets:** *Product Grid*, *Editorial Bands*. ## 5. Image with text One idea, a supporting image, and focused copy. No blocks. **Settings:** `eyebrow`, `title` (Text), `body` (Textarea), `url` (Link), `label` (Text), `image` (Image), `media_placement` (EnumButtons → `MediaPlacement`), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Presets:** *Product Story*. ## 6. Stats Concise metrics in a grid or band. **Settings:** `eyebrow`, `title` (Text), `intro` (Textarea), `layout` (Select: `grid` / `band`), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Blocks:** `stat` — `icon` (Icon), `value` (Text), `label` (Text), `description` (Textarea). **Presets:** *Metric Grid*. ## 7. Testimonials Customer quotes as cards, a featured quote, or a compact list. **Settings:** `eyebrow`, `title` (Text), `intro` (Textarea), `layout` (Select: `cards` / `featured` / `compact`), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Blocks:** `quote` — `quote` (Textarea), `name` (Text), `role` (Text), `avatar` (Image). **Presets:** *Customer Proof*. ## 8. Pricing Comparable pricing plans with a highlightable tier. **Settings:** `eyebrow`, `title` (Text), `intro` (Textarea), `billing_note` (Text), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Blocks:** `plan` — `name` (Text), `price` (Text), `period` (Text), `description` (Textarea), `features` (Textarea, one per line), `highlighted` (Toggle), `url` (Link), `label` (Text). **Presets:** *Three Plan*. ## 9. FAQ Accessible disclosure list — no JavaScript required. **Settings:** `eyebrow`, `title` (Text), `intro` (Textarea), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Blocks:** `item` — `question` (Text), `answer` (Textarea). **Presets:** *Launch FAQ*. ## 10. Rich text Long-form content with an article or split-with-aside layout. No blocks. **Settings:** `eyebrow`, `title` (Text), `body` (RichText), `aside_title` (Text), `aside_body` (RichText), `layout` (Select: `article` / `split`), `width` (Select: `sm` / `md` / `lg`), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme), `surface` (Toggle — wrap content in a surface). **Presets:** *Founder Note*, *Editorial Essay*. ## 11. CTA A conversion moment as a centered card, split callout, or inline banner. No blocks. **Settings:** `badge` (Text), `heading` (Text), `subheading` (Textarea), `note` (Text), `url` (Link), `label` (Text), `layout` (Select: `center` / `split` / `banner`), `align` (EnumButtons → `SectionAlignment`), `shape` + `density` (EnumButtons), `scheme` (ColorScheme). **Presets:** *Launch Card*, *Sales Banner*. ## 12. Footer A branded footer with a description, copyright, and grouped links. **Settings:** `brand` (Text), `description` (Textarea), `copyright` (Textarea), `density` (EnumButtons → `SectionDensity`), `shape` (EnumButtons → `SectionShape`), `scheme` (ColorScheme). **Blocks:** `link` — `column` (Text, optional grouping heading), `label` (Text), `description` (Textarea), `url` (Link). **Presets:** *Studio Footer*, *Minimal Footer*. *** ## Presets A **preset** is a named starting point — a bundle of settings and blocks the editor can apply in one click. Built-in sections ship the presets listed above; you can define your own on a [custom section](/guide/custom-sections#presets) by returning `Preset` objects from a static `presets()` method. ## Blocks A **block** is a repeatable child item within a section (a nav link, a pricing plan, a quote). Blocks have their own settings schema and an optional `limit`. See [Custom Sections](/guide/custom-sections#blocks) for how to declare them. --- --- url: /guide/custom-sections.md --- # Custom Sections Custom sections are first-class citizens. Drop a class anywhere on the autoloader, extend `BladeSection`, and FilamentCraft renders it in the editor and on published pages — the same pipeline the [built-in sections](/guide/built-in-sections) use. ## A minimal section ```php namespace App\Sections; use FilamentCraft\Sections\BladeSection; use FilamentCraft\Settings\Types\Image; use FilamentCraft\Settings\Types\Text; use FilamentCraft\Settings\Types\Textarea; final class TestimonialSection extends BladeSection { protected static string $view = 'sections.testimonial'; public static function slug(): string { return 'testimonial'; } public static function name(): string { return 'Testimonial'; } public static function settings(): array { return [ Textarea::make('quote')->label('Quote')->required(), Text::make('author')->label('Author')->required(), Image::make('avatar')->label('Avatar'), ]; } public static function defaults(): array { return [ 'settings' => [ 'quote' => 'A useful quote about the product.', 'author' => 'Customer Name', ], 'blocks' => [], ]; } } ``` The matching Blade view (`resources/views/sections/testimonial.blade.php`) receives a `$section` data object: ```blade
{{ $section->settings->get('quote') }}
{{ $section->settings->get('author') }}
``` ::: tip Scaffold it `php artisan make:filamentcraft-section Testimonial` generates the class and Blade view (or a Livewire class with `--livewire`). See [Make Commands](/reference/commands). ::: ## The Section contract `BladeSection` implements `FilamentCraft\Sections\Contracts\Section` via the `SectionSchema` trait, which supplies sensible defaults for everything except the view. Override only what you need: | Method | Returns | Default | Purpose | |---|---|---|---| | `slug()` | `string` | kebab of class name minus `-section` | Stable id stored in revisions. | | `name()` | `string` | headline of the slug | Display label in the catalog. | | `category()` | `string` | `'general'` | Catalog grouping. | | `description()` | `?string` | `null` | Sub-label in the catalog. | | `icon()` | `string` | `heroicon-o-puzzle-piece` | Catalog icon. | | `maxBlocks()` | `int` | `16` | Cap on total blocks across all block types. | | `wrapper()` | `string` | `'section'` | The HTML tag/selector wrapping the rendered output. | | `settings()` | `array` | `[]` | The settings schema (see below). | | `blocks()` | `array` | `[]` | Repeatable child blocks. | | `presets()` | `array` | `[]` | Named starting points. | | `enabledOn()` | `array` | `['*']` | Template types the section is offered on. | | `disabledOn()` | `array` | `[]` | Template types to exclude. | | `previewImageUrl()` | `?string` | `null` | Catalog thumbnail. | | `defaults()` | `array` | `['settings' => [], 'blocks' => []]` | Initial content when added. | `slug()`, `name()`, `settings()`, and `defaults()` are the ones you'll usually define. ## Settings `settings()` returns an array of [setting types](/guide/inputs/overview). It can mix the FilamentCraft DSL with **raw Filament v4 components** — the compiler wires `live()` on every leaf field so the preview keeps updating, and resolves visibility from either the DSL's `visibleIf([...])` shortcut or Filament's native `visible(Closure)` callback. ```php use Filament\Forms\Components\Toggle; use Filament\Schemas\Components\Utilities\Get; use FilamentCraft\Settings\Types\Group; use FilamentCraft\Settings\Types\Text; public static function settings(): array { return [ Group::make('content')->label('Content'), Text::make('heading')->label('Heading')->default('Welcome'), Group::make('cta')->label('Call to action')->collapsed(), Toggle::make('cta_enabled')->label('Show button')->default(true), Text::make('cta_label')->label('Button label') ->visibleIf(['cta_enabled' => true]), // DSL shortcut Text::make('cta_note')->label('Note') ->visible(fn (Get $get): bool => (bool) $get('cta_enabled')), // native closure ]; } ``` Use `Group` to break a long form into labelled clusters — see [Layout & Structure](/guide/inputs/layout). ## Blocks A **block** is a repeatable child item (a nav link, a pricing plan, a quote). Declare them with `Block::make('slug')`, each with its own settings schema and an optional `limit`: ```php use FilamentCraft\Sections\Block; use FilamentCraft\Settings\Types\Text; use FilamentCraft\Settings\Types\Link; public static function blocks(): array { return [ Block::make('nav-link') ->name('Nav link') ->limit(6) ->settings([ Text::make('label')->label('Label')->default('Page'), Link::make('url')->label('URL')->default('/'), ]), ]; } ``` Read blocks in the Blade view from `$section->blocks`. The `maxBlocks()` cap (default 16) limits the *total* number of blocks added to one section instance, across every block type. ## Presets A **preset** is a named bundle of settings and blocks the editor can apply in one click. Return `Preset` objects from `presets()`: ```php use FilamentCraft\Sections\Preset; public static function presets(): array { return [ Preset::make('split-header', 'Split Header') ->settings([ 'brand_text' => 'Acme', 'cta_enabled' => true, ]) ->blocks([ ['id' => 'nav-1', 'type' => 'nav-link', 'settings' => ['label' => 'Product', 'url' => '/product']], ['id' => 'nav-2', 'type' => 'nav-link', 'settings' => ['label' => 'Pricing', 'url' => '/pricing']], ]), ]; } ``` In the editor, presets surface behind the **Browse presets** button on the section's header — each one is a one-click starting point. ## Registering a section Two ways — both are calls on the plugin instance in your panel provider: ```php use FilamentCraft\FilamentCraftPlugin; public function panel(Panel $panel): Panel { return $panel->plugin( FilamentCraftPlugin::make() ->registerSection(\App\Sections\TestimonialSection::class) // …or auto-discover a whole directory: ->discoverSectionsIn(app_path('Sections')) ); } ``` The conventional path `app/Sections/` is auto-scanned with no extra config. ## Extending a built-in section The bundled sections are intentionally subclassable. Give the subclass its own slug, optionally point it at a custom view, and override only what you want to change: ```php namespace App\Sections; use FilamentCraft\Sections\Builtin\HeroSection; class ProductHeroSection extends HeroSection { protected static string $view = 'sections.product-hero'; public static function slug(): string { return 'product-hero'; } public static function name(): string { return 'Product hero'; } } ``` Register the subclass with `->registerSection(ProductHeroSection::class)`. It inherits the parent's settings, blocks, and presets unless you override those methods too. ## Related * [Built-in Sections](/guide/built-in-sections) — the 12 shipped sections and their settings. * [Setting Types](/guide/inputs/overview) — every input you can put in `settings()`. * [Curating the Catalog](/guide/curating-the-catalog) — control which sections appear. * [Testing Sections](/reference/testing) — the `SectionDataFactory` for Pest tests. --- --- url: /guide/curating-the-catalog.md --- # Curating the Catalog The **catalog** is the *Add Section* picker inside the editor — the menu of section types a content editor can insert into a page. By default it contains all 12 [built-in sections](/guide/built-in-sections) plus any [custom sections](/guide/custom-sections) you've registered or discovered. Curating the catalog lets you decide **which section types appear in that picker**, without breaking pages that already use a type. ::: info Catalog ≠ rendering These filters affect **only** the Add Section picker. A section type that's already placed in a template keeps rendering on the published page even if you later hide it from the catalog — existing content never breaks. ::: ## Show only a short list `allowSections()` takes an allow-list of slugs. When set, the catalog shows *only* those types — everything else is hidden, built-in or custom. ```php use FilamentCraft\FilamentCraftPlugin; FilamentCraftPlugin::make() ->allowSections(['hero', 'features', 'cta']); ``` Use this when editors should work from a deliberately small, on-brand set. ## Hide a few types `withoutSections()` is the inverse: keep the full library *except* the slugs you name. ```php FilamentCraftPlugin::make() ->withoutSections(['pricing', 'logo-cloud']); ``` The named types are removed from the picker but stay **registered**, so any template already using them continues to render. ## Drop the built-ins entirely To remove **all 12** built-in sections — for example when you ship your own complete library — turn them off: ```php FilamentCraftPlugin::make() ->withBuiltinSections(false) ->discoverSectionsIn(app_path('Sections')); ``` With `withBuiltinSections(false)`, the built-in classes are never registered, so the catalog contains only your custom sections. ## Configure via `config/filamentcraft.php` `allowSections()` and `withoutSections()` write to config, so you can set the same values in `config/filamentcraft.php` instead of code: ```php 'builtin_sections_enabled' => true, // toggled by withBuiltinSections() 'sections' => [ 'allowed' => ['hero', 'features', 'cta'], // null = allow all 'disabled' => ['pricing'], ], ``` | Plugin method | Config key | |---|---| | `allowSections([...])` | `filamentcraft.sections.allowed` | | `withoutSections([...])` | `filamentcraft.sections.disabled` | | `withBuiltinSections(bool)` | `filamentcraft.builtin_sections_enabled` | The plugin methods take precedence when both are set. ## How the rules combine 1. **Built-ins** register only when `builtin_sections_enabled` is true (default). 2. **Custom sections** register via `registerSection()` / `discoverSectionsIn()`. 3. The catalog then shows every registered type, **filtered** by `allowed` (if set) and minus `disabled`. So `allowSections()` is a whitelist applied on top of whatever is registered, and `withoutSections()` is a blacklist — they can be combined, but `allowSections()` is the stronger constraint. --- --- url: /guide/inputs/overview.md --- # Setting Types Every editable control in FilamentCraft — whether it lives in a **section's** settings panel or a **theme's** template-settings panel — is declared with a small PHP DSL. Each control is a `Setting` subclass under `FilamentCraft\Settings\Types`, instantiated with a `make('id')` call and configured fluently: ```php use FilamentCraft\Settings\Types\Text; Text::make('heading') ->label('Heading') ->default('Welcome') ->required(); ``` The editor compiles each `Setting` into a real Filament v4 form component at runtime, so the inputs you get are the same battle-tested fields Filament renders everywhere else — wired up for FilamentCraft's live-preview bus. ## The 18 built-in types | Type | Class | Page | |---|---|---| | Text | `Text` | [Text inputs](/guide/inputs/text) | | Textarea | `Textarea` | [Text inputs](/guide/inputs/text) | | Number | `Number` | [Text inputs](/guide/inputs/text) | | Range | `Range` | [Text inputs](/guide/inputs/text) | | Select | `Select` | [Choice inputs](/guide/inputs/choice) | | Radio | `Radio` | [Choice inputs](/guide/inputs/choice) | | Checkbox | `Checkbox` | [Choice inputs](/guide/inputs/choice) | | Enum buttons | `EnumButtons` | [Choice inputs](/guide/inputs/choice) | | Color | `Color` | [Color inputs](/guide/inputs/color) | | Color scheme | `ColorScheme` | [Color inputs](/guide/inputs/color) | | Color scheme group | `ColorSchemeGroup` | [Color inputs](/guide/inputs/color) | | Font | `Font` | [Font picker](/guide/inputs/font) | | Image | `Image` | [Media & content](/guide/inputs/media) | | Icon | `Icon` | [Media & content](/guide/inputs/media) | | Link | `Link` | [Media & content](/guide/inputs/media) | | Rich text | `RichText` | [Media & content](/guide/inputs/media) | | Group | `Group` | [Layout & structure](/guide/inputs/layout) | | Category | `Category` | [Layout & structure](/guide/inputs/layout) | ## Shared API (every type) All setting types inherit the same base methods from `FilamentCraft\Settings\Setting`: | Method | Purpose | |---|---| | `make(string $id)` | Construct the setting. The id must match `/^[a-z0-9_][a-z0-9_-]*$/i`. | | `label(string $label)` | The field label shown in the editor. | | `default(mixed $value)` | The value used until the user changes it. | | `info(string $text)` | Helper text rendered under the field. | | `required(bool $value = true)` | Mark the field required. | | `visibleIf(array $predicates)` | Show the field only when other fields match — e.g. `->visibleIf(['cta_enabled' => true])`. | | `cssVar(string $name, ?string $unit = null)` | Bind the value to a CSS custom property in `