Skip to content

Components: Example

Kerry Lyons edited this page Oct 11, 2022 · 5 revisions

Example panel

A simple panel which contains a useful resource, tips, an example, case study or external content such as a tool or service.

Screenshot of the example banner component

When to use it

When you need to display something useful to the user and bring attention to it.

How to use it

You can use multiple of these on a page.

Leave an empty line before and after to improve readability of the code.

Code

The ruby extension accepts 2 parameters, title and content

<%= example_panel("title","HTML content") %>

Example:

## Section title

...

<%= example_panel("Tools and resources", "<a href='#' target='_blank'>Estimate how many people in the UK have a disability</a>.") %>

...

When not to use it

  • Don't use for general content
  • Don't repeat page content in the panel
  • Don't use it to display legal warning, use the warning component instead.
  • Don't use it to display a notification message, use the banner component instead.
Clone this wiki locally