A Laravel Nova field to write raw HTML and preview.
interaction-design-foundation/nova-html-code-field is a Laravel package for a laravel nova field to write raw html and preview..
It currently has 10 GitHub stars and 210.070 downloads on Packagist (latest version 2.2.0).
Install it with composer require interaction-design-foundation/nova-html-code-field.
Discover more Laravel packages by interaction-design-foundation
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel Nova field that provides a powerful HTML code editor with real-time preview capabilities. Write raw HTML and see instant results, with the preview rendered in an isolated iframe to prevent style conflicts with Nova's UI.

You can install the package via composer:
composer require interaction-design-foundation/nova-html-code-field
The package will automatically register its service provider.
use InteractionDesignFoundation\NovaHtmlCodeField\HtmlCode;
public function fields(NovaRequest $request): array
{
return [
HtmlCode::make('HTML Content', 'content'),
];
}
use InteractionDesignFoundation\NovaHtmlCodeField\HtmlCode;
public function fields(NovaRequest $request): array
{
return [
HtmlCode::make('HTML Content', 'content')
// Include stylesheets into iframe for more accurate preview
->styles([
'https://cdn.example.com/custom.css', // from a CDN
Vite::asset('resources/css/app.css'), // from your app
])
// Wrap the HTML content in a template ("%CODE%" is required)
->previewTemplate('<section class="panel">%CODE%</section>'),
];
}
Please see CONTRIBUTING for details on how to contribute to this project.
composer test
# Fix code style
composer cs:fix
If you discover any security-related issues, please email the maintainers instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.