Directory

← Back

prism-element

Syntax / code highlighting via the Prism webcomponent.

Author

Rating

Popularity

<100

Integration of the <prism-element> Webcomponent. Enables you to display syntax highlighted code via Prism.

Sample code

new PrismHighlighter("p { color: blue; }");
new PrismHighlighter("p { color: blue; }","css");
new PrismHighlighter("@Route(\"\")\n" +
        "public class DemoView extends VerticalLayout {\n" +
        "\n" +
        "    public DemoView() {\n" +
        "        add(\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\"),\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\"),\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\"),\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\")\n" +
        "        );\n" +
        "    }\n" +
        "}\n");
new PrismHighlighter("@Route(\"\")\n" +
        "public class DemoView extends VerticalLayout {\n" +
        "\n" +
        "    public DemoView() {\n" +
        "        add(\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\"),\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\"),\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\"),\n" +
        "                new PrismHighlighter(\"<style>p { color: blue; }</style>\", \"html\")\n" +
        "        );\n" +
        "    }\n" +
        "}\n","java");

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

  • fixed issues with java code syntax highlighting
Released
2019-02-17
Maturity
BETA
License
Apache License 2.0

Compatibility

Framework
Vaadin 10+
Vaadin 14+ in 2.0.0.beta1
Browser
Firefox
Google Chrome
Microsoft Edge

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online