Extending fields - adding icon

Hey there,
I want to extend a simple text field inside Kirby::plugin, using this:

    'fields' => [
        'myfield' => [
            'extends' => 'text',
            'props' => [
                'icon' => 'home',
            ],
        ],
    ],

… but that doesn’t work - it should just be a text field with the specified icon -.-

thx!

1 Like

Have you also created an index.js? And what exactly doesn’t work? No icon? No field?

I’m not sure if replacing the icon is best done on the JS or PHP field file. However, you are extending the wrong component in the JS file, it needs to match the name found in kirby/panel/src/config/components.js.

'extends' => 'k-text-field',

But not in the PHP file, in the js file.