PHPackages                             webkenth/filament-code-field - 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. [Templating &amp; Views](/categories/templating)
4. /
5. webkenth/filament-code-field

ActiveLibrary[Templating &amp; Views](/categories/templating)

webkenth/filament-code-field
============================

A Filamentphp input field to edit or view code data.

1.0.10(3y ago)117MITPHP

Since Apr 5Pushed 3y agoCompare

[ Source](https://github.com/WebKenth/filament-code-field)[ Packagist](https://packagist.org/packages/webkenth/filament-code-field)[ Docs](https://github.com/creagia/filament-code-field)[ GitHub Sponsors](https://github.com/creagia)[ RSS](/packages/webkenth-filament-code-field/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Filamentphp code field
======================

[](#filamentphp-code-field)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7d5854824065111982dcc6040a27a4c53f7db93a871791ea377af044d6a4ccdc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f637265616769612f66696c616d656e742d636f64652d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/creagia/filament-code-field)[![GitHub Tests Action Status](https://camo.githubusercontent.com/62c62287f161322a019304c8e6f8499c556bb78b30b8195df3a1f86ee1346e92/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f637265616769612f66696c616d656e742d636f64652d6669656c642f72756e2d74657374732e796d6c3f6c6162656c3d7465737473)](https://github.com/creagia/filament-code-field/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f520d579e7ce96b26273a6f8893684a7e645bf72a57808289b907e06b5ec51ad/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f637265616769612f66696c616d656e742d636f64652d6669656c642f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6c6162656c3d636f64652532307374796c65)](https://github.com/creagia/filament-code-field/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/682b1ee0957aaa5b1b116e14f190862f6a00d3955db6ac3f6deb54aec9eca7f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f637265616769612f66696c616d656e742d636f64652d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/creagia/filament-code-field)

A [CodeMirror](https://codemirror.net/) powered code field for the Filamentphp admin panel and form builder.

With code autocompletion, light/dark modes, multiple languages, read-only mode and more.

Check screenshots and read more about the package in our [blog post](https://creagia.com/blog/a-code-field-for-the-filamentphp-admin-panel-and-form-builder).

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

[](#installation)

You can install the package via composer:

```
composer require creagia/filament-code-field
```

Usage
-----

[](#usage)

Creating a code field is straightforward, just instantiate the `CodeField` class for the desired property.

```
use Creagia\FilamentCodeField\CodeField;

return $form
    ->schema([
        CodeField::make('my_json'),
        // other fields
    ]);
```

### Choosing another language

[](#choosing-another-language)

By default, a JSON field will be created.

If you want to create a field for another supported language, you can do so with the `setLanguage()` and helper methods.

Supported languages: JSON, PHP, HTML, XML and JavaScript (JS).

```
use Creagia\FilamentCodeField\CodeField;

return $form
    ->schema([
        CodeField::make('js_code')
            ->setLanguage(CodeField::JS),
            // or
            ->jsField()
    ]);
```

### Disabling code completion

[](#disabling-code-completion)

By default, the field comes with code completion/suggestions enabled.

For disabling this feature, use the `disableAutocompletion()`.

```
use Creagia\FilamentCodeField\CodeField;

return $form
    ->schema([
        CodeField::make('js_code')
            ->htmlField()
            ->disableAutocompletion(),
    ]);
```

### Line numbers

[](#line-numbers)

Line numbers can be enabled using the `withLineNumbers()` method.

```
use Creagia\FilamentCodeField\CodeField;

return $form
    ->schema([
        CodeField::make('json')
            ->withLineNumbers(),
    ]);
```

### Read-only mode

[](#read-only-mode)

Adding the Filamentphp `disabled()` method will make the code field read-only.

```
use Creagia\FilamentCodeField\CodeField;

return $form
    ->schema([
        CodeField::make('json')
            ->disabled(),
    ]);
```

### Filamentphp methods

[](#filamentphp-methods)

Of course, the code field extends the `Filamentphp` field class, and you can use all the usual methods such as `label()`.

```
use Creagia\FilamentCodeField\CodeField;

return $form
    ->schema([
        CodeField::make('json')
            ->label('Your JSON data')
            ->hint('Top right corner info')
            ->helper('More info after the text field')
            // more methods
            ,
    ]);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.5% 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 ~0 days

Total

2

Last Release

1132d ago

### Community

Maintainers

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

---

Top Contributors

[![ricardcreagia](https://avatars.githubusercontent.com/u/33965585?v=4)](https://github.com/ricardcreagia "ricardcreagia (16 commits)")[![dtorras](https://avatars.githubusercontent.com/u/240932?v=4)](https://github.com/dtorras "dtorras (4 commits)")[![WebKenth](https://avatars.githubusercontent.com/u/13419123?v=4)](https://github.com/WebKenth "WebKenth (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![wilfredchen](https://avatars.githubusercontent.com/u/46327334?v=4)](https://github.com/wilfredchen "wilfredchen (1 commits)")

---

Tags

laravelcode editorfilamentcreagiafilament-code-fieldfilament field

### Embed Badge

![Health badge](/badges/webkenth-filament-code-field/health.svg)

```
[![Health](https://phpackages.com/badges/webkenth-filament-code-field/health.svg)](https://phpackages.com/packages/webkenth-filament-code-field)
```

###  Alternatives

[creagia/filament-code-field

A Filamentphp input field to edit or view code data.

58289.3k3](/packages/creagia-filament-code-field)[amidesfahani/filament-tinyeditor

Filament TinyMce Editor

99328.8k4](/packages/amidesfahani-filament-tinyeditor)[andreia/filament-nord-theme

A minimalist Arctic Nord theme for FilamentPHP

13334.7k2](/packages/andreia-filament-nord-theme)[riodwanto/filament-ace-editor

An ACE editor field for Filament forms with syntax highlighting, themes, and autocompletion.

2065.8k4](/packages/riodwanto-filament-ace-editor)[tomatophp/filament-plugins

Manage your modules as a plugin system with plugin generator

644.7k2](/packages/tomatophp-filament-plugins)[filafly/brisk

A simple, friendly theme for Filament.

2211.9k1](/packages/filafly-brisk)

PHPackages © 2026

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