Example

Example is an Shortcode. It does not require a Nunjucks import statement.

Inception alert! The example component is used in Kanga docs to show examples of components. It currently works with:

  • Markdown .md files
  • Nunjucks .njk files

The component will render the example in an iFrame at the specified height and extract the code into a details.

Open this example in a new tab
View the code for this example
<example url='/kanga/example/components/example-example' height='180'>

Shortcode arguments

Call the shortcode like so:

<example url="/url/of/example" height="300">
Argument Type Description
file string Required. The file that contains the example code. Don’t use the file extension; this will be auto-detected. Supports .md or .njk
height string The height of the iFrame. Defaults to 300.