Skip to content

React & Vue Sections (Islands) ​

An island is a section whose markup comes from a React or Vue component in your own Vite bundle. You still declare its settings, blocks and presets in PHP, so the editor sidebar, presets, translations, AI fill and site export work exactly as they do for Blade sections. The component receives those settings as props and re-renders when an editor changes one, without losing its own state.

bash
php artisan make:filamentcraft-island PricingCalculator

That one command:

  • writes app/Sections/PricingCalculatorSection.php, an IslandSection;
  • writes resources/js/islands/PricingCalculator.tsx (or .vue, detected from package.json; force it with --react / --vue);
  • creates resources/js/filamentcraft-islands.ts on first run, the entry that registers every component in resources/js/islands/;
  • creates resources/css/filamentcraft-islands.css when you use Tailwind, compiling only the utilities your islands use;
  • adds the entry to the input array in vite.config.

Run npm run dev (or npm run build) and the section shows up in the editor's Add section picker.

The section class ​

php
use FilamentCraft\Sections\Block;
use FilamentCraft\Sections\IslandSection;
use FilamentCraft\Settings\Types\Number;
use FilamentCraft\Settings\Types\Text;

final class PricingCalculatorSection extends IslandSection
{
    protected static string $component = 'pricing-calculator';

    public static function settings(): array
    {
        return [
            Text::make('heading')->default('Pay for the seats you use'),
            Number::make('default_seats')->default(5),
        ];
    }

    public static function blocks(): array
    {
        return [
            Block::make('plan')->settings([
                Text::make('name')->default('Team'),
                Number::make('seat_price')->default(9),
            ]),
        ];
    }
}
PropertyDefaultPurpose
$componentthe section slugIsland name. A file's kebab-cased name is its island name: PricingCalculator.tsx registers pricing-calculator.
$fallbacknullA Blade view (it receives $section) shown until the component mounts, and to crawlers and visitors without JavaScript.
$containedtrueWraps the island in the theme's container width. Set false for full-bleed.

The section shell still applies the color scheme and section spacing, so islands sit in the theme like any built-in section.

Props ​

Every setting arrives as a prop under its id, with schema defaults filled in, plus a blocks array and an island context:

ts
{
  heading: 'Pay for the seats you use',
  default_seats: 5,
  image: { url, alt, width, height, srcset },    // Image settings
  cta: { href, label, external, target },        // Link settings
  intro: '<p>Sanitized <strong>HTML</strong></p>', // RichText settings
  blocks: [{ id: 'b1', type: 'plan', name: 'Team', seat_price: 9 }],
  island: { editing: true, locale: 'en', dir: 'ltr' },
}

island.editing is true inside the editor canvas. Use it for editor-only hints, or to pause autoplay while someone is editing. To pass something else, override props():

php
public static function props(SectionData $section): array
{
    return [...parent::props($section), 'currency' => config('shop.currency')];
}

Theme-aware styling

Islands render inside your site's theme. Use the theme tokens (var(--fc-color-primary), var(--fc-color-on-primary), var(--fc-color-surface)…) and the shared primitives (fc-card, fc-btn, fc-eyebrow) so an island re-skins along with every other section when the theme changes.

Styles and component libraries ​

resources/css/filamentcraft-islands.css compiles only the Tailwind utilities your islands use, in a filamentcraft-islands layer declared after FilamentCraft's own. That ordering matters: without it, the site CSS's base rules (img { height: auto }, transparent buttons) would beat utilities like h-60 or bg-teal-500.

Copy-paste libraries such as shadcn/ui or Aceternity UI work inside islands. Add their folder as a source and any keyframes they expect:

css
@source '../js/components/aceternity';

@theme {
    --animate-scroll: scroll var(--animation-duration, 40s) var(--animation-direction, forwards) linear infinite;

    @keyframes scroll {
        to { transform: translate(calc(-50% - 0.5rem)); }
    }
}

Components written for Next.js need small changes: replace next/image with <img>, and give fill images h-full w-full themselves.

Using an island inside a Blade section ​

The mount point is a Blade component, so any Blade or Livewire section can embed a component:

blade
<x-filamentcraft::island name="revenue-chart" :props="['points' => $points]" class="h-80">
    <p>Loading chart…</p>
</x-filamentcraft::island>

Pass :section="$section" instead of :props to forward the section's settings. Livewire morphs skip an island's children automatically.

How it behaves ​

  • In the editor, a settings change refreshes the section and the island receives new props; its local state (a slider position, an open accordion) is kept. Moving, duplicating, hiding and undoing sections mount and unmount islands correctly.
  • With npm run dev, Vite serves the islands entry inside the editor canvas, and React Fast Refresh / Vue HMR update components without reloading the page.
  • On the live site, the entry is a single deferred module script, code-split per component. A page with no islands loads nothing extra.
  • If the build is missing, debug mode throws Laravel's usual Vite error; production renders the fallback HTML instead of failing the page.

Configuration ​

Islands work without configuration. These keys in config/filamentcraft.php cover unusual setups:

php
'islands' => [
    'entries' => ['resources/js/filamentcraft-islands.ts'], // entries whose file is missing are skipped
    'build_directory' => null, // defaults to Laravel's `build`
    'hot_file' => null,        // a separate Vite dev server for islands
    'react_refresh' => null,   // null = on when package.json has @vitejs/plugin-react
],

Limits ​

  • Islands render in the browser. Crawlers see the $fallback view, so keep SEO-critical copy in Blade sections or in the fallback.
  • Inline text editing in the canvas (liveUpdate) applies to Blade markup only. Island settings update through a section refresh instead, which still keeps the component's state.
  • filamentcraft.assets.site_js_enabled must stay true, because islands mount from the package's site script.
  • With a white-label prefix the storefront renders <sew-island> instead of <fc-island>. Your entry keeps pushing to window.FilamentCraftIslands, which both the editor and the renamed storefront bundle read.