# Implement a Cell Plugin to customise the Cell behaviour based on metadata

**URL:** <https://discourse.jupyter.org/t/implement-a-cell-plugin-to-customise-the-cell-behaviour-based-on-metadata/3361>\
**Category:** JupyterLab\
**Created:** [February 18, 2020, 1:51pm UTC](https://discourse.jupyter.org/t/implement-a-cell-plugin-to-customise-the-cell-behaviour-based-on-metadata/3361 "2020-02-18T13:51:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano\_Fioravanzo](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/stefano_fioravanzo/32/849_2.png) [@Stefano\_Fioravanzo](https://discourse.jupyter.org/u/Stefano_Fioravanzo)\
**Post date:** [February 18, 2020, 1:51pm UTC](https://discourse.jupyter.org/t/implement-a-cell-plugin-to-customise-the-cell-behaviour-based-on-metadata/3361/1 "2020-02-18T13:51:12Z")

</div>

I would like to implement a plugin that extends the behaviour of Notebook Cells in the following way:

- Change the color of the cell contour based on the cell metadata
- Add some input fields on top of the cell, that let the user change the cell’s metadata

I was able to achieve this by implementing a `JupyterFrontEndPlugin` and accessing the `NotebookPanel`. But the result is suboptimal as the only way to add the inline input fields above the cells is to force my custom inputs in the DOM, making the page very slow when I have many cells.

What would be ideal is to have a custom cell that is used by Jupyter instead of the default cell.  
This is an example of what I have achieved now, by injecting elements into the DOM:

 ![Screenshot 2020-02-18 at 15.49.06](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/5/56d7077b49fea26ad65a2321fc9e15d867916596.png)

Can anyone help with this?

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [February 19, 2020, 8:07am UTC](https://discourse.jupyter.org/t/implement-a-cell-plugin-to-customise-the-cell-behaviour-based-on-metadata/3361/2 "2020-02-19T08:07:02Z")

</div>

See also [Styling Code and Markdown cells from tags](https://discourse.jupyter.org/t/styling-code-and-markdown-cells-from-tags/3235) which was a similar request regarding whether there were any extensions / tricks out there for styling cells based on tags for vanilla Jupyter notebooks.
