Intro container

The vf-intro component is to be used as the main title of a page or section where you need to include some additional text in a larger typeface. The vf-hero can take a heading, lede text, and paragraph(s) of text. It can also include a badge on the heading which can be a link.

github location npm version

Usage

Use in vf-eleventy

To use this component in a vf-eleventy project you will need to set the context for the content to pass through from the nunjucks file associated yaml file and include it.

{% set context = UniqueContextName %}
{% include containers.vf_intro %}

note: due to how nunjucks handles special characters we have remove the @ at sign and need to replace the - hyphen used for an _ underscore to { include } a component or container. As shown above instead of writing something like { include containers.@vf-intro } we need to type { include containers.intro }

You may wish to make use of some of your projects side specific data or content. To do this you will need to set the relevant items of content before you {% include ... %} the component. Note: If you also declare this content in the .yml file it will take precedence over the inlined code.

For example. If you wanted to make use of your projects siteConfig information. You can write out the inclusion of the component in you pages .njk file like so:

{% set context = UniqueContextName %}
{% set vf_intro_heading = siteConfig.siteInformation.short_description %}
{% include containers.intro %}

Content

The vf-intro allows for a variety of text.

content type variable description
text vf_intro_heading
text vf_intro_phase
url vf_intro_heading_href
text vf_intro_lede
group vf_intro_text
text intro_text


The vf-intro_phase, vf_intro_heading_href, vf_intro_lede, vf_intro_text, and intro_text are all optional.

To include intro_text you will have to nest and indent the content inside/underneath the vf_intro_text in the .yml file, like:

vf_intro_text:
  - This is an example of intro text paragraph.
  - This is an example of a second intro text paragraph.

Variants

Transversal research themes beta

Understanding life in the context of its environment

EMBL’s future directions will be driven by the goal of understanding life in the context of its environment. While the effects of the environment on living systems have been well studied at the level of individual organisms and populations, many of the underlying molecular processes remain obscure.

We now have the tools and technologies to explore these processes, allowing us to understand life in its natural context from the level of molecules to whole ecosystems. This new understanding will be critically important if we are to tackle societal challenges such as environmental degradation and loss of biodiversity, climate change, and threats to human health such as the emergence of new epidemics.

EMBL’s new transversal research themes will enable us to realise this vision of understanding life in context. The transversal research themes will be highly interdisciplinary and will encourage dynamic internal and external collaborations. These themes will enable transformative discoveries by bringing together experts in fields such as ecology, epidemiology, toxicology, zoology, population genetics, engineering, and mathematical theory. There will be strong support for building collaborations within each theme, as well as with the wider scientific community, not only to enable scientific discovery but also to build these themes across the EMBL sites.

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",
  "id": "an-id-for-anchor",
  "vf_intro_heading": "Transversal research themes",
  "vf_intro_badge": {
    "style": [
      "phases"
    ],
    "text": "beta",
    "theme": "primary",
    "badge_href": "JavaScript:Void(0);"
  },
  "vf_intro_subheading": "Understanding life in the context of its environment",
  "vf_intro_lede": "EMBL’s future directions will be driven by the goal of understanding life in the context of its environment. While the effects of the environment on living systems have been well studied at the level of individual organisms and populations, many of the underlying molecular processes remain obscure.",
  "vf_intro_text": [
    "We now have the tools and technologies to explore these processes, allowing us to understand life in its natural context from the level of molecules to whole ecosystems. This new understanding will be critically important if we are to tackle societal challenges such as environmental degradation and loss of biodiversity, climate change, and threats to human health such as the emergence of new epidemics.",
    "EMBL’s new transversal research themes will enable us to realise this vision of understanding life in context. The transversal research themes will be highly interdisciplinary and will encourage dynamic internal and external collaborations. These themes will enable transformative discoveries by bringing together experts in fields such as ecology, epidemiology, toxicology, zoology, population genetics, engineering, and mathematical theory. There will be strong support for building collaborations within each theme, as well as with the wider scientific community, not only to enable scientific discovery but also to build these themes across the EMBL sites."
  ]
}
 %}
{% include "../path_to/vf-intro/vf-intro.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-intro', {
  "component-type": "container",
  "id": "an-id-for-anchor",
  "vf_intro_heading": "Transversal research themes",
  "vf_intro_badge": {
    "style": [
      "phases"
    ],
    "text": "beta",
    "theme": "primary",
    "badge_href": "JavaScript:Void(0);"
  },
  "vf_intro_subheading": "Understanding life in the context of its environment",
  "vf_intro_lede": "EMBL’s future directions will be driven by the goal of understanding life in the context of its environment. While the effects of the environment on living systems have been well studied at the level of individual organisms and populations, many of the underlying molecular processes remain obscure.",
  "vf_intro_text": [
    "We now have the tools and technologies to explore these processes, allowing us to understand life in its natural context from the level of molecules to whole ecosystems. This new understanding will be critically important if we are to tackle societal challenges such as environmental degradation and loss of biodiversity, climate change, and threats to human health such as the emergence of new epidemics.",
    "EMBL’s new transversal research themes will enable us to realise this vision of understanding life in context. The transversal research themes will be highly interdisciplinary and will encourage dynamic internal and external collaborations. These themes will enable transformative discoveries by bringing together experts in fields such as ecology, epidemiology, toxicology, zoology, population genetics, engineering, and mathematical theory. There will be strong support for building collaborations within each theme, as well as with the wider scientific community, not only to enable scientific discovery but also to build these themes across the EMBL sites."
  ]
} %}
                
HTML
<section class="vf-intro" id="an-id-for-anchor">

  <div>
    <!-- empty -->
  </div>

  <div class="vf-stack">

    <h1 class="vf-intro__heading vf-intro__heading--has-tag">Transversal research themes

      <a href="JavaScript:Void(0);" class="vf-badge vf-badge--primary vf-badge--phases">beta</a>
    </h1>
    <h2 class="vf-intro__subheading">Understanding life in the context of its environment</h2>

    <p class="vf-lede">EMBL’s future directions will be driven by the goal of understanding life in the context of its environment. While the effects of the environment on living systems have been well studied at the level of individual organisms and populations, many of the underlying molecular processes remain obscure.</p>


    <p class="vf-intro__text">We now have the tools and technologies to explore these processes, allowing us to understand life in its natural context from the level of molecules to whole ecosystems. This new understanding will be critically important if we are to tackle societal challenges such as environmental degradation and loss of biodiversity, climate change, and threats to human health such as the emergence of new epidemics.</p>
    <p class="vf-intro__text">EMBL’s new transversal research themes will enable us to realise this vision of understanding life in context. The transversal research themes will be highly interdisciplinary and will encourage dynamic internal and external collaborations. These themes will enable transformative discoveries by bringing together experts in fields such as ecology, epidemiology, toxicology, zoology, population genetics, engineering, and mathematical theory. There will be strong support for building collaborations within each theme, as well as with the wider scientific community, not only to enable scientific discovery but also to build these themes across the EMBL sites.</p>
  </div>
</section>
              

Examples

Installation info

This repository is distributed with npm. After installing npm and yarn, you can install with this command.

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

Sass/CSS

The source files included are written in Sass(scss). You can point your Sass include-path at your node_modules directory and import it like this.

@import "@visual-framework/vf-intro/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.2.0

  • Update node-html-parser to 5.1.0
  • Use eleventy v1.0.0-beta.8
  • https://github.com/visual-framework/vf-core/pull/1257

1.1.16

  • Utilise new vf-navigation--on-this-page.
  • Update project boilerplate links at https://stable.visual-framework.dev/building/

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-intro

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