Elementor Code Block Widget with Syntax Highlighting (Pro)

Source Code is a Master Addons Pro widget for showing code snippets on an Elementor page. Paste the code, pick one of 75 languages and one of eight Prism.js themes, and the block renders with syntax colors, optional line numbers and a copy to clipboard button. Visitors can read and copy the code but not edit it. It fits tutorials, documentation, changelogs and developer portfolios.

How to Add a Code Block in Elementor

Source Code needs Elementor and an active Master Addons Pro license.

  1. Activate Master Addons Pro, edit the page with Elementor and search the widgets panel for Source Code.
  2. Drag it where the snippet belongs.
  3. Pick the language in Code and a Theme.
  4. Paste the snippet into the Source Code box.
  5. Turn on the copy button and line numbers, and set the button text, visibility and position.
  6. In the Style tab, set a Height for long snippets and style the button, then preview the page and test Copy.

Every setting is covered in the Source Code widget settings guide.

HTML document snippet with line numbers and a copy button, next to the Code language list and Theme dropdown

75 Languages and 8 Prism.js Themes

The Code dropdown lists 75 languages, from HTML, CSS, JavaScript and PHP to Python, Bash, SQL, JSON, YAML, TypeScript, React JSX, Go, Kotlin and Swift. Theme offers Default, Dark, Funky, Okaidia, Twilight, Coy, Solarized light and Tomorrow. Choose Custom to set your own background, text color, line number color and typography in the Style tab.

  • Use a light theme such as Default or Solarized light on white pages, and Okaidia or Tomorrow on dark sections.
  • Custom has no keyword colors: the code shows in the single text color you pick, so use a preset theme when you want syntax colors.
  • One widget holds one snippet. Place several widgets side by side for code and output.

Elementor Pro Code Highlight vs Master Addons Source Code

Elementor Pro has its own Code Highlight widget. Both use Prism.js, so the choice comes down to the extras you need.

FeatureElementor Pro Code HighlightMaster Addons Source Code
PriceNeeds Elementor ProNeeds Master Addons Pro
Languages3775
Themes6 (Solid, Dark, Okaidia, Solarizedlight, Tomorrow, Twilight)8 plus Custom colors
Copy buttonCopy to Clipboard switchCustom text, copied text, Always or On Hover, two positions, full styling
Line numbersYesYes
Highlight linesYesNo
Word wrapYesNo
Height and font sizeYesHeight, plus typography with the Custom theme

Choose Elementor Pro if you need to highlight specific lines or wrap long lines. Choose Master Addons if you want more languages, more themes or a styled copy button. Related: Table of Contents for long tutorials and Dynamic Table for reference tables.

Copy Button and Line Numbers

Switch on Enable Copy Button to add a button that copies the whole snippet. Set its Copy Button Text, the After Copied Button Text shown after a click, Button Visibility (Always or On Hover) and Button Position (top right or bottom right corner). Enable Line Number adds numbers down the left side.

  • Keep the button set to Always on tutorial pages so readers notice it.
  • Line numbers make it easy to refer to a line in your text.
  • There is no option to highlight specific lines or wrap long lines inside the widget.
Source Code content settings with a jQuery snippet, copy button and line number switches, Button Visibility options and Button style section
C++ code and output blocks on the Okaidia theme, beside the Container style settings for height, padding and border

Container and Button Styling

The Container section sets a Height (up to 1200px) so long snippets scroll, plus padding, margin, border and radius. With the Custom theme it also adds a background, typography, text color and line number color. The Button section styles the copy button with typography, text color, background color, padding, border and radius.

  • Cap the height on long files so the page stays readable.
  • Match the button background to your brand color.
  • Add padding so the code does not touch the block edges.
Template Viewer
Facebook
Twitter
WhatsApp
Copy Link
Buy Now
Source Code with HTML Document
Source Code with HTML Document
Source Code with jQuery
Source Code with jQuery
Source Code with PHP
Source Code with PHP
Source Code with C++
Source Code with C++
YAML on Okaidia Theme
YAML on Okaidia Theme
CSS on Solarized Light Theme
CSS on Solarized Light Theme
HTML, CSS and JavaScript on Tomorrow Theme
HTML, CSS and JavaScript on Tomorrow Theme
JavaScript on Okaidia Theme
JavaScript on Okaidia Theme

Frequently Asked Questions For Source Code

Learn the most asked queries users have about Source Code and find answers in one place.
Is the Source Code widget free?

No. Source Code is part of Master Addons Pro. Elementor Pro users also have Elementor’s Code Highlight widget.

Yes. Set Enable Line Number to No for a cleaner block.

Set Button Position to the top right or bottom right corner, and Button Visibility to Always or On Hover.

Which languages does the Source Code widget support?

75, picked in the Code dropdown. They include HTML, CSS, JavaScript, PHP, Python, Bash, SQL, JSON, YAML, Markdown, TypeScript, React JSX and TSX, Go, Java, Kotlin, Swift, Ruby, C, C++ and C#. Visitors can read and copy the code but cannot edit it.

Partly. Set Theme to Custom to choose the background, text color, line number color and typography in the Container style section. Keyword colors only come with the eight preset themes, so a Custom block shows code in one color unless you add your own CSS.

No. The widget has no line highlight option. Elementor Pro’s Code Highlight widget can highlight chosen lines if you need that.

Trending Elementor Widgets & Extensions

Build sophisticated websites in less time.

Master Addons Glassmorphism extension for Elementor: frosted glass cards with the Blur Value control set to 20px

Glassmorphism

Home Free Elementor Glassmorphism Extension: Frosted Glass Effect in One Toggle Glassmorphism is the frosted...
View Details
Master Addons Container Extras extension for Elementor: container capped at a 1400px Max Width, with Max Width, Max Height, Min Width and Min Height controls

Container Extras

Home Elementor Container Max Width and Max Height Controls Container Extras is a free Master...
View Details
Master Addons Patterns extension for Elementor: hero with the Purple Gradient Grid Left style, three more pattern styles and the Enable Pattern panel

Patterns

Home 70+ Free Elementor Background Patterns Patterns is a free Master Addons extension that adds...
View Details
Master Addons Post/Page Duplicator extension for Elementor: MA Duplicator row link in the WordPress Pages list creating a Landing Page - [Duplicated #128] draft

Post/Page Duplicator

Home Duplicate Elementor Pages and Posts in One Click Post/Page Duplicator is a free Master...
View Details
Master Addons Reading Progress Bar extension for Elementor: blue bar 42% filled across the top of a privacy policy page, with enable, position, height and fill color settings

Reading Progress Bar

Home Add a Reading Progress Bar in WordPress (Elementor) Reading Progress Bar is a free...
View Details