PHPackages                             iperamuna/filament-ace-editor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. iperamuna/filament-ace-editor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iperamuna/filament-ace-editor
=============================

Ace Editor implementation for Filament 5 Forms and Infolists

1.2.0(5mo ago)0142MITPHPPHP ^8.2

Since Jan 27Pushed 5mo agoCompare

[ Source](https://github.com/iperamuna/filament-ace-editor)[ Packagist](https://packagist.org/packages/iperamuna/filament-ace-editor)[ Docs](https://github.com/iperamuna/filament-ace-editor)[ RSS](/packages/iperamuna-filament-ace-editor/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

[![Filament Ace Editor Banner](./artwork/banner.png)](./artwork/banner.png)

Filament Ace Editor (Supporting Filament v5)
============================================

[](#filament-ace-editor-supporting-filament-v5)

[![Latest Version on Packagist](https://camo.githubusercontent.com/751a5e10929f560d005c26ad00ca4fc1afe19e2ab6ac4a4bf83211a9b8f643b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69706572616d756e612f66696c616d656e742d6163652d656469746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iperamuna/filament-ace-editor)[![Total Downloads](https://camo.githubusercontent.com/c20c8c75bbf63a9bf035686bc2aa4e467a7808f9356fdf823f7e5c4aa68c1216/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69706572616d756e612f66696c616d656e742d6163652d656469746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iperamuna/filament-ace-editor)[![License](https://camo.githubusercontent.com/0ebc7bd7d3c10b5ee1b3895757d7f4709f22a11ea1942e27099967039b44a6e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f69706572616d756e612f66696c616d656e742d6163652d656469746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iperamuna/filament-ace-editor)

A powerful Ace Editor implementation for Filament v5 Forms and Infolists with syntax highlighting, themes, autocompletion, and read-only mode support.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12.x
- Filament 5.x

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require iperamuna/filament-ace-editor
```

The package will automatically detect your Filament version and work seamlessly with your installation.

Usage
-----

[](#usage)

### Basic Form Field

[](#basic-form-field)

```
use Iperamuna\FilamentAceEditor\AceEditor;

AceEditor::make('content')
    ->label('Code Editor')
    ->mode('php')
    ->theme('monokai')
    ->minLines(20)
    ->maxLines(50);
```

### Advanced Configuration

[](#advanced-configuration)

```
AceEditor::make('script_content')
    ->label('Shell Script')
    ->hint(fn ($state) => new HtmlString(
        view('components.copy-button', ['content' => $state])->render()
    ))
    ->mode('sh')
    ->theme('monokai')
    ->minLines(20)
    ->maxLines(30)
    // Toggleable edit/read-only mode
    ->toggleable(true)
    // Control initial read-only state
    ->defaultReadOnly(fn ($livewire) => $livewire->getRecord() !== null)
    // Add extensions
    ->addExtension('searchbox')
    // Custom editor options
    ->options([
        'tabSize' => 2,
        'showPrintMargin' => false,
        'enableBasicAutocompletion' => true,
    ]);
```

### Infolist Entry

[](#infolist-entry)

```
use Iperamuna\FilamentAceEditor\AceEditorEntry;

AceEditorEntry::make('content')
    ->label('Script Content')
    ->mode('sh')
    ->theme('monokai')
    ->minLines(15)
    ->maxLines(50);
```

Key Features
------------

[](#key-features)

### 🔒 Read-Only Mode Control

[](#-read-only-mode-control)

The `defaultReadOnly()` method helps prevent unwanted edits, especially useful when editing existing records. You can control it with a boolean or closure:

```
// Always read-only initially
AceEditor::make('config')
    ->defaultReadOnly(true);

// Read-only when editing existing records, editable when creating new ones
AceEditor::make('script_content')
    ->defaultReadOnly(fn ($livewire) => $livewire->getRecord() !== null);

// Custom logic based on user permissions
AceEditor::make('sensitive_data')
    ->defaultReadOnly(fn ($livewire) => !auth()->user()->can('edit', $livewire->getRecord()));

// Disable read-only mode entirely
AceEditor::make('content')
    ->defaultReadOnly(false);
```

**Example Use Case**: When a form is in create mode, the editor automatically opens in edit mode. When viewing or editing an existing record, it starts in read-only mode to prevent accidental changes. Users can toggle to edit mode when needed.

### 🎨 Theme Support

[](#-theme-support)

```
// Light theme for day work
AceEditor::make('content')
    ->theme('github');

// Dark theme for night owls
AceEditor::make('content')
    ->theme('monokai');
```

Available themes include: `monokai`, `github`, `tomorrow`, `twilight`, `solarized_light`, `solarized_dark`, and many more.

### 🔧 Toggleable Edit Mode

[](#-toggleable-edit-mode)

Allow users to switch between read-only and edit modes:

```
AceEditor::make('content')
    ->toggleable(true)  // Shows EDIT/DONE toggle button
    ->defaultReadOnly(true);  // Starts in read-only mode
```

### 📏 Flexible Sizing

[](#-flexible-sizing)

```
AceEditor::make('content')
    ->minLines(10)   // Minimum editor height
    ->maxLines(50);  // Maximum editor height
```

### 🧩 Extensions Support

[](#-extensions-support)

```
AceEditor::make('content')
    ->addExtension('searchbox')
    ->addExtension('beautify')
    ->addExtension('language_tools');
```

Configuration
-------------

[](#configuration)

Publish the configuration file to customize defaults:

```
php artisan vendor:publish --tag="filament-ace-editor-config"
```

This creates `config/filament-ace-editor.php`:

```
return [
    'base_url' => 'https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.7',

    'editor_options' => [
        'enableBasicAutocompletion' => true,
        'enableLiveAutocompletion' => true,
        'enableSnippets' => true,
        'showPrintMargin' => true,
        'highlightActiveLine' => true,
        'displayIndentGuides' => true,
    ],

    'enabled_extensions' => [
        'language_tools',
        'beautify',
        'searchbox',
    ],
];
```

### Available Methods

[](#available-methods)

MethodDescriptionDefault`mode(string)`Set syntax highlighting mode`'sh'``theme(string)`Set editor theme`'monokai'``minLines(int)`Set minimum editor height`15``maxLines(int)`Set maximum editor height`50``toggleable(bool)`Enable edit/read-only toggle`true``defaultReadOnly(bool|Closure)`Set initial read-only state`true``addExtension(string)`Add Ace extension`[]``options(array)`Override editor options`[]`Supported Languages
-------------------

[](#supported-languages)

Ace Editor supports over 110 programming languages and markup formats. Common modes include:

**Programming Languages:**

- `php`, `python`, `javascript`, `typescript`, `java`, `c_cpp`, `ruby`, `go`, `rust`

**Web Technologies:**

- `html`, `css`, `scss`, `less`, `json`, `xml`, `yaml`

**Data &amp; Config:**

- `sql`, `mysql`, `pgsql`, `ini`, `toml`, `dockerfile`

**Scripting:**

- `sh` (Shell/Bash), `powershell`, `batchfile`

**Markup:**

- `markdown`, `latex`, `asciidoc`

See the [Ace Editor documentation](https://ace.c9.io/) for the complete list of supported modes.

Publishing
----------

[](#publishing)

Publish the views for customization:

```
php artisan vendor:publish --tag="filament-ace-editor-views"
```

Publish the configuration:

```
php artisan vendor:publish --tag="filament-ace-editor-config"
```

Supported Features
------------------

[](#supported-features)

This package supports most powerful features from [Ace Editor](https://ace.c9.io/#features):

- ✅ Syntax highlighting for 110+ languages
- ✅ Multiple themes (light and dark)
- ✅ Code autocompletion
- ✅ Search and replace
- ✅ Code folding
- ✅ Multiple cursors
- ✅ Line numbering
- ✅ Automatic indentation
- ✅ Read-only mode with toggle
- ✅ Customizable key bindings
- ✅ Extensions support

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Indunil Peramuna](https://iperamuna.online)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance73

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

152d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

1.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7f282b7449477d5baaf64bdb40fcb7d9c8c638fb96a431413c7293344e3182f?d=identicon)[iperamuna](/maintainers/iperamuna)

---

Top Contributors

[![iperamuna](https://avatars.githubusercontent.com/u/3013395?v=4)](https://github.com/iperamuna "iperamuna (12 commits)")

---

Tags

laravelcode editorfilamentace-editorfilament-ace-editor

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/iperamuna-filament-ace-editor/health.svg)

```
[![Health](https://phpackages.com/badges/iperamuna-filament-ace-editor/health.svg)](https://phpackages.com/packages/iperamuna-filament-ace-editor)
```

###  Alternatives

[ysfkaya/filament-phone-input

A phone input component for Laravel Filament

3161.3M25](/packages/ysfkaya-filament-phone-input)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

211189.7k8](/packages/bezhansalleh-filament-google-analytics)[creagia/filament-code-field

A Filamentphp input field to edit or view code data.

57307.1k3](/packages/creagia-filament-code-field)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
