beta This component version is ready to be used but is still in active development.

Hero github location npm version

The vf-hero component is to be used as a visual queue and page header. As needed, it can take a kicker, heading, sub-heading, text content, and a 'call to action' link.


Variants


Usage

By default the vf-hero makes use of the roundels background image. To keep the raw structure of the HTML and CSS the same this is applied using a CSS custom property.

The default variant is equivalent to vf-hero--1200 and the recommended image size is 3000 by 1000 pixels.

Content

Content name Usage .yml key
Heading To be used for the heading of the page. vf_hero_heading
Heading HREF To be used as a 'return to home' link for the micro site. vf_hero_heading_href
Subheading Optional content to be used along with the Heading for a terse explainer. vf_hero_subheading
Kicker Optional content that helps define the context of overall content of the page. vf_hero_kicker
Text Optional content that can help explain the page content in a brief paragraph. vf_hero_text
Link Text The text for the hero 'call to action' link. Only works if there is associated Link HREF. vf_hero_link_text
Link HREF The url that the Link Text would be pointing to and opens in the same browser tab. This only works if there is associated Link Text vf_hero_link_href
Content name .yml key CSS classname
Kicker vf_hero_kicker vf-hero__kicker
Heading vf_hero_heading vf-hero__heading
Heading HREF vf_hero_heading_href vf-hero__heading_link
Subheading vf_hero_subheading vf-hero__subheading
Text vf_hero_text vf-hero__text
Link Text vf_hero_link_text vf-hero__link
Link HREF vf_hero_link_href n/a

CSS Custom Properties

--vf-hero--bg-image — this is for the url for the background image. It can either be added, inline if you're writing the HTML, using the .yml data source of vf_hero_image, or by other needs (a input or upload in WordPress, for example).

---vf-hero--bg-image-size — this is to determine the sizing of the background image. As group sites are using the roundel image it needs specific dimensions so that it works. These dimensions are auto 28.5rem. We use a fallback here as background images in vf-hero should be full bleed by default so the fall back in the CSS is for cover — var(---vf-hero--bg-image-size, cover).

Internet Explorer support

IE 11 will get the background colour and the "roundels" image. Under the approach of progressive enhancement, IE 11 will not paint a different background image if added.

EMBL usage

For EMBL sites, the vf-hero can take an image (provided by Design) which should be uploaded to the files site and applied using the custom property available (--vf-hero--bg-image).

VF Hamburg | Structural Biology

About the Hentze group!

an example of some ancillary text

The Hentze group combines biochemical and systems–level approaches to investigate the connections between gene expression and cell metabolism, and their roles in human disease.

Learn more
Nunjucks syntax

Depending on your environment you'll want to use render or include. As a rule of thumb: server-side use include, precompiled browser use render. If you're using vf-eleventy you should use include.

Using include

You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include is an abstraction of render and provides some additional portability.


{% set context fromYourYamlFile %}
- or -
{% set context = {
  "component-type": "container",
  "vf_hero_kicker": "<a href=\"JavaScript:Void(0);\">VF Hamburg</a> | Structural Biology",
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_heading_href": "JavaScript:Void(0);",
  "vf_hero_subheading": "an example of some ancillary text",
  "vf_hero_text": [
    "The Hentze group combines biochemical and <a href=\"JavaScript:Void(0);\">systems–level approaches</a> to investigate the connections between <a href=\"JavaScript:Void(0);\">gene expression</a> and <a href=\"JavaScript:Void(0);\">cell metabolism</a>, and their roles in human disease."
  ],
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image_size": "auto 28.5rem"
}
 %}
{% include "../path_to/vf-hero/vf-hero.njk" %}
                

Using render

This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include is not be available.

{% render '@vf-hero', {
  "component-type": "container",
  "vf_hero_kicker": "<a href=\"JavaScript:Void(0);\">VF Hamburg</a> | Structural Biology",
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_heading_href": "JavaScript:Void(0);",
  "vf_hero_subheading": "an example of some ancillary text",
  "vf_hero_text": [
    "The Hentze group combines biochemical and <a href=\"JavaScript:Void(0);\">systems–level approaches</a> to investigate the connections between <a href=\"JavaScript:Void(0);\">gene expression</a> and <a href=\"JavaScript:Void(0);\">cell metabolism</a>, and their roles in human disease."
  ],
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image_size": "auto 28.5rem"
} %}
                
HTML
<section class="vf-hero | vf-u-fullbleed" style=" --vf-hero--bg-image-size: auto 28.5rem">
  <div class="vf-hero__content | vf-box | vf-stack vf-stack--400">
    <p class="vf-hero__kicker"><a href="JavaScript:Void(0);">VF Hamburg</a> | Structural Biology</p>
    <h2 class="vf-hero__heading"><a class="vf-hero__heading_link" href="JavaScript:Void(0);">About the Hentze group!</a></h2>

    <p class="vf-hero__subheading">an example of some ancillary text</p>
    <p class="vf-hero__text">The Hentze group combines biochemical and <a href="JavaScript:Void(0);">systems–level approaches</a> to investigate the connections between <a href="JavaScript:Void(0);">gene expression</a> and <a href="JavaScript:Void(0);">cell metabolism</a>, and their roles in human disease.</p> <a class="vf-hero__link" href="JavaScript:Void(0);">Learn more<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">
        <path d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0C5.376.008.008 5.376 0 12zm13.707-5.209l4.5 4.5a1 1 0 010 1.414l-4.5 4.5a1 1 0 01-1.414-1.414l2.366-2.367a.25.25 0 00-.177-.424H6a1 1 0 010-2h8.482a.25.25 0 00.177-.427l-2.366-2.368a1 1 0 011.414-1.414z" fill="" fill-rule="nonzero"></path>
      </svg>
    </a>
  </div>
</section>
              

VF Hamburg | Structural Biology

About the Hentze group!

an example of some ancillary text

The Hentze group combines biochemical and systems–level approaches to investigate the connections between gene expression and cell metabolism, and their roles in human disease.

Learn more
Nunjucks syntax

Depending on your environment you'll want to use render or include. As a rule of thumb: server-side use include, precompiled browser use render. If you're using vf-eleventy you should use include.

Using include

You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include is an abstraction of render and provides some additional portability.


{% set context fromYourYamlFile %}
- or -
{% set context = {
  "component-type": "container",
  "vf_hero_kicker": "<a href=\"JavaScript:Void(0);\">VF Hamburg</a> | Structural Biology",
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_subheading": "an example of some ancillary text",
  "vf_hero_text": [
    "The Hentze group combines biochemical and <a href=\"JavaScript:Void(0);\">systems–level approaches</a> to investigate the connections between <a href=\"JavaScript:Void(0);\">gene expression</a> and <a href=\"JavaScript:Void(0);\">cell metabolism</a>, and their roles in human disease."
  ],
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image": "url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/vf-hero-intense.png');"
}
 %}
{% include "../path_to/vf-hero/vf-hero.njk" %}
                

Using render

This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include is not be available.

{% render '@vf-hero', {
  "component-type": "container",
  "vf_hero_kicker": "<a href=\"JavaScript:Void(0);\">VF Hamburg</a> | Structural Biology",
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_subheading": "an example of some ancillary text",
  "vf_hero_text": [
    "The Hentze group combines biochemical and <a href=\"JavaScript:Void(0);\">systems–level approaches</a> to investigate the connections between <a href=\"JavaScript:Void(0);\">gene expression</a> and <a href=\"JavaScript:Void(0);\">cell metabolism</a>, and their roles in human disease."
  ],
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image": "url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/vf-hero-intense.png');"
} %}
                
HTML
<section class="vf-hero | vf-u-fullbleed" style="--vf-hero--bg-image: url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/vf-hero-intense.png');">
  <div class="vf-hero__content | vf-box | vf-stack vf-stack--400">
    <p class="vf-hero__kicker"><a href="JavaScript:Void(0);">VF Hamburg</a> | Structural Biology</p>
    <h2 class="vf-hero__heading">About the Hentze group!</h2>

    <p class="vf-hero__subheading">an example of some ancillary text</p>
    <p class="vf-hero__text">The Hentze group combines biochemical and <a href="JavaScript:Void(0);">systems–level approaches</a> to investigate the connections between <a href="JavaScript:Void(0);">gene expression</a> and <a href="JavaScript:Void(0);">cell metabolism</a>, and their roles in human disease.</p> <a class="vf-hero__link" href="JavaScript:Void(0);">Learn more<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">
        <path d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0C5.376.008.008 5.376 0 12zm13.707-5.209l4.5 4.5a1 1 0 010 1.414l-4.5 4.5a1 1 0 01-1.414-1.414l2.366-2.367a.25.25 0 00-.177-.424H6a1 1 0 010-2h8.482a.25.25 0 00.177-.427l-2.366-2.368a1 1 0 011.414-1.414z" fill="" fill-rule="nonzero"></path>
      </svg>
    </a>
  </div>
</section>
              

A journey through bioinformatics

Explore resources from EMBL-EBI

Nunjucks syntax

Depending on your environment you'll want to use render or include. As a rule of thumb: server-side use include, precompiled browser use render. If you're using vf-eleventy you should use include.

Using include

You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include is an abstraction of render and provides some additional portability.


{% set context fromYourYamlFile %}
- or -
{% set context = {
  "component-type": "container",
  "spacing": 400,
  "vf_hero_heading": "A journey through bioinformatics",
  "vf_hero_text": [
    "Explore resources from EMBL-EBI"
  ],
  "vf_hero_image_size": "auto 28.5rem"
}
 %}
{% include "../path_to/vf-hero/vf-hero.njk" %}
                

Using render

This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include is not be available.

{% render '@vf-hero', {
  "component-type": "container",
  "spacing": 400,
  "vf_hero_heading": "A journey through bioinformatics",
  "vf_hero_text": [
    "Explore resources from EMBL-EBI"
  ],
  "vf_hero_image_size": "auto 28.5rem"
} %}
                
HTML
<section class="vf-hero vf-hero--400 | vf-u-fullbleed" style=" --vf-hero--bg-image-size: auto 28.5rem">
  <div class="vf-hero__content | vf-box | vf-stack vf-stack--400">
    <h2 class="vf-hero__heading">A journey through bioinformatics</h2>

    <p class="vf-hero__text">Explore resources from EMBL-EBI</p>
  </div>
</section>
              

About the Hentze group!

Learn more
Nunjucks syntax

Depending on your environment you'll want to use render or include. As a rule of thumb: server-side use include, precompiled browser use render. If you're using vf-eleventy you should use include.

Using include

You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include is an abstraction of render and provides some additional portability.


{% set context fromYourYamlFile %}
- or -
{% set context = {
  "component-type": "container",
  "spacing": 800,
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image_size": "auto 28.5rem"
}
 %}
{% include "../path_to/vf-hero/vf-hero.njk" %}
                

Using render

This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include is not be available.

{% render '@vf-hero', {
  "component-type": "container",
  "spacing": 800,
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image_size": "auto 28.5rem"
} %}
                
HTML
<section class="vf-hero vf-hero--800 | vf-u-fullbleed" style=" --vf-hero--bg-image-size: auto 28.5rem">
  <div class="vf-hero__content | vf-box | vf-stack vf-stack--400">
    <h2 class="vf-hero__heading">About the Hentze group!</h2>

    <a class="vf-hero__link" href="JavaScript:Void(0);">Learn more<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">
        <path d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0C5.376.008.008 5.376 0 12zm13.707-5.209l4.5 4.5a1 1 0 010 1.414l-4.5 4.5a1 1 0 01-1.414-1.414l2.366-2.367a.25.25 0 00-.177-.424H6a1 1 0 010-2h8.482a.25.25 0 00.177-.427l-2.366-2.368a1 1 0 011.414-1.414z" fill="" fill-rule="nonzero"></path>
      </svg>
    </a>
  </div>
</section>
              

About the Hentze group!

an example of some ancillary text

Learn more
Nunjucks syntax

Depending on your environment you'll want to use render or include. As a rule of thumb: server-side use include, precompiled browser use render. If you're using vf-eleventy you should use include.

Using include

You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include is an abstraction of render and provides some additional portability.


{% set context fromYourYamlFile %}
- or -
{% set context = {
  "component-type": "container",
  "spacing": 1200,
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_subheading": "an example of some ancillary text",
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image_size": "auto 28.5rem"
}
 %}
{% include "../path_to/vf-hero/vf-hero.njk" %}
                

Using render

This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include is not be available.

{% render '@vf-hero', {
  "component-type": "container",
  "spacing": 1200,
  "vf_hero_heading": "About the Hentze group!",
  "vf_hero_subheading": "an example of some ancillary text",
  "vf_hero_link_text": "Learn more",
  "vf_hero_link_href": "JavaScript:Void(0);",
  "vf_hero_image_size": "auto 28.5rem"
} %}
                
HTML
<section class="vf-hero vf-hero--1200 | vf-u-fullbleed" style=" --vf-hero--bg-image-size: auto 28.5rem">
  <div class="vf-hero__content | vf-box | vf-stack vf-stack--400">
    <h2 class="vf-hero__heading">About the Hentze group!</h2>

    <p class="vf-hero__subheading">an example of some ancillary text</p> <a class="vf-hero__link" href="JavaScript:Void(0);">Learn more<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">
        <path d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0C5.376.008.008 5.376 0 12zm13.707-5.209l4.5 4.5a1 1 0 010 1.414l-4.5 4.5a1 1 0 01-1.414-1.414l2.366-2.367a.25.25 0 00-.177-.424H6a1 1 0 010-2h8.482a.25.25 0 00.177-.427l-2.366-2.368a1 1 0 011.414-1.414z" fill="" fill-rule="nonzero"></path>
      </svg>
    </a>
  </div>
</section>
              
Installation info

This repository is distributed with npm. After installing npm, you can install vf-hero with this command.

$ yarn add --dev @visual-framework/vf-hero

Sass/CSS

The style files included are written in Sass. If you're using a VF-core project, you can import it like this:

@import "@visual-framework/vf-hero/index.scss";

Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter

Changelog

Changelog

1.1.13

  • Documentation updates
  • New release

1.1.12

  • Update milestones and roadmap.

1.1.11

  • Add ELIXIR banner to example EMBL-EBI page.
  • https://stable.visual-framework.dev/patterns/boilerplate-generic-embl-ebi/
  • https://github.com/visual-framework/vf-core/pull/1615

1.1.7

  • Fixed issue of overlapping menu on VF components site
  • https://github.com/visual-framework/vf-core/issues/1518

1.1.6

  • dependency bump

1.1.2

  • Implements updated vf-search markup.
  • Changes a few pages on how it works with nunjucks and markdown.

1.1.0

  • updates Design Tokens homepage.
  • adds neutral colour tokens
  • adds 'status banners' for components in the documentation page.
  • Adds the form options as their own set of components in the list.
  • https://github.com/visual-framework/vf-core/pull/1390/files
  • Updates to use 11ty 0.12.1
  • https://github.com/visual-framework/vf-core/pull/1435

1.0.24

  • changes the vf-intro so it's a white background, removes the padding.
  • changes the links in vf-intro to be the 'correct' buttons.

1.0.23

  • small change to cards on homepage

1.0.18

  • dependency bump

1.0.17

  • dependency bump

1.0.16

  • dependency bump

1.0.13

  • dependency bump
  • adds roamap and consultation docs

1.0.12

  • design token documenation now lives in the component libary

1.0.7

  • adds updates blog

1.0.6

  • begin to make more pattern/boilerplate guidance
  • minor templating updates

1.0.5

  • dependency bump

1.0.4

  • uses vf-favicon
  • adds meta attributes

1.0.3

  • run vf-component-assets:everything on local dev
  • remove reference to removed /css/app.css

1.0.2

  • Add 404
  • Fix component CSS generation

1.0.1

  • Also generate per-component CSS with vf-css:generate-component-css

1.0.0

  • Initial release to be used with vf-core 2.2.0

Assets



File system location: components/vf-hero

Find an issue on this page? Propose a change or discuss it.