Skip to main content
Developer

Syntax Code Highlighter for Breakdance

A code block with syntax highlighting, line numbers and a copy button. Show code in tutorials and docs without another plugin.

Free Uses Prism, bundled in the plugin and loaded only on pages that have a code block.
Live preview
functions.php php
<?php
// Add a custom class to the body element.
add_filter( 'body_class', function ( $classes ) {
	$classes[] = 'has-breakui';
	return $classes;
} );

This is the real element, running with its sample content.

Syntax highlighting

Pick a language and a theme. Highlighting runs with Prism, bundled in the plugin.

Line numbers and highlighted lines

Number the lines, start at any number and highlight lines such as 1,3-5.

Copy button

Visitors copy the code with one click.

Header and scrolling

A filename header bar, long line wrapping and a max height that scrolls.

Add it to your page in 3 steps

1

Open your page in Breakdance

In WordPress, go to Pages, hover over your page and click Edit with Breakdance.

Pages
Your page
Edit with Breakdance
2

Open the element panel

Click the plus button at the top left, then open the BreakUI Pro group and find Syntax Code Highlighter.

Add
BreakUI Pro
Syntax Code Highlighter
3

Drag it into your layout

Drop it into a section or container. It loads with sample content so you can see it working right away.

Drag
Drop on the page
Done

What it looks like in the editor

Real screenshots from the Breakdance editor. Select the element, then use the Content tab for your data and the Design tab for the look.

Syntax Code Highlighter element Content tab in the Breakdance editor
1 Content tab: add your text, items and data
Syntax Code Highlighter element Design tab in the Breakdance editor
2 Design tab: colors, spacing and typography

The main settings

Select the element in Breakdance. Everything lives in two tabs.

Content tab

Your text, items, links and behavior. Change the sample content and you are done.

Design tab

Colors, typography, borders, spacing and layout, with the normal Breakdance controls.

Element Width

Set the width in percent, pixels, em, rem, vw or vh, plus max width, min width and alignment.

Design
Spacing
Element Width

Style it your way

The Design tab has these groups. Everything uses the normal Breakdance design controls.

Header Bar
Title Typography Background
Code
Typography Background Max Height Highlighted Line Background Line Number Color
Copy Button
Background Text Color

The copy button copies exactly what is in the code field.

Set a max height so long snippets do not push your layout down.

Get BreakUI ProFree, no account, no license key.
Download the plugin