The vf-box
container is an element to be used when ...
A vf-box
can be used in all grid systems and also inside of vf-content
.
For now vf-box
is only designed to accept a heading and text (both have classes). The text node – vf-box__text
can also accept a link which will inherit the text colour.
If you require the vf-box
to link to a page you can do this by:
<div>
to an <a href="">
.vf-box--is-link
to the classes being used..njk
you only need to add a box_href
to the data.There are currently two Design variants available. To add the appropriate level of design you can add a component–level class:
vf-box--easy
vf-box--normal
note: you need a design variant set at the page (todo), container (todo), or component level to make use of the themes available to avoid any potential conflicts with code or unexpected results
The vf-box
component allows for global and component–level theming so that it is customisable to your needs.
To make use of the component–level theming you will need to add a theme classname to the component.
The theme classnames available are:
vf-box-theme--primary
vf-box-theme--secondary
vf-box-theme--tertiary
vf-box-theme--quaternary
vf-box-theme--quinary
Since v1.1.0
the following components are considered depracted and should not be used in new projects:
vf-box--inlay
vf-box--factoid
To update your existing usage of these variants to use the component–level theming you can swap:
vf-box--inlay
for vf-box--normal vf-box-theme--quinary
vf-box--factoid
for vf-box--normail vf-box-theme--primary
Do not use the themes vf-box-theme--qauternary
or vf-box-theme--quinary
with the design variant vf-box--easy
as they do not conform to WCAG colour contrast ratio specifications.
This component is distributed with npm. After installing npm, you can install the vf-box
with this command.
$ yarn add --dev @visual-framework/vf-box
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-box/index.scss";
Make sure you import Sass requirements along with the modules.
File system location: components/vf-box
{% render '@vf-box--default', {
"component-type": "block",
"box": {
"box_href": "JavaScript:Void(0);",
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box."
}
} %}
<a href="JavaScript:Void(0);" class="vf-box vf-box--is-link">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</a>
{% render '@vf-box--is-a-link', {
"component-type": "block",
"box": {
"box_href": "JavaScript:Void(0);",
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--is-link"
}
} %}
<a href="JavaScript:Void(0);" class="vf-box vf-box--is-link vf-box--is-link">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</a>
{% render '@vf-box--very-easy', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--very-easy"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--very-easy">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--easy', {
"component-type": "block",
"box": {
"box_href": "JavaScript:Void(0);",
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--easy"
}
} %}
<a href="JavaScript:Void(0);" class="vf-box vf-box--is-link vf-box--easy">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</a>
{% render '@vf-box--easy-(primary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--easy vf-box-theme--primary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--easy vf-box-theme--primary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--easy-(secondary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--easy vf-box-theme--secondary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--easy vf-box-theme--secondary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--easy-(tertiary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--easy vf-box-theme--tertiary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--easy vf-box-theme--tertiary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--easy-(quaternary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--easy vf-box-theme--quaternary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--easy vf-box-theme--quaternary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--easy-(quinary)', {
"component-type": "block",
"box": {
"box_href": "JavaScript:Void(0);",
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--easy vf-box-theme--quinary"
}
} %}
<a href="JavaScript:Void(0);" class="vf-box vf-box--is-link vf-box--easy vf-box-theme--quinary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</a>
{% render '@vf-box--normal', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--normal"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--normal">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--normal-(primary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--normal vf-box-theme--primary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--normal vf-box-theme--primary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--normal-(secondary)', {
"component-type": "block",
"box": {
"box_href": "JavaScript:Void(0);",
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--normal vf-box-theme--secondary"
}
} %}
<a href="JavaScript:Void(0);" class="vf-box vf-box--is-link vf-box--normal vf-box-theme--secondary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</a>
{% render '@vf-box--normal-(tertiary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--normal vf-box-theme--tertiary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--normal vf-box-theme--tertiary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--normal-(quaternary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--normal vf-box-theme--quaternary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--normal vf-box-theme--quaternary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--normal-(quinary)', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--normal vf-box-theme--quinary"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--normal vf-box-theme--quinary">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--hard', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--hard"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--hard">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--extreme', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--extreme"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--extreme">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--intense', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "This is some more content that would be in the box.",
"box_modifier": "vf-box--intense"
}
} %}
This is some more content that would be in the box.
<div class="vf-box vf-box--intense">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
{% render '@vf-box--factoid', {
"component-type": "block",
"box": {
"box_heading": "Did You Know?",
"box_text": "Invasive cancer is the leading cause of death in the developed world and the second leading in the developing world.",
"box_modifier": "vf-box--factoid",
"deprecated_text": "vf-box--factoid is now deprecated, please use `vf-box--theme--primary`"
}
} %}
Invasive cancer is the leading cause of death in the developed world and the second leading in the developing world.
<!-- vf-box--factoid is now deprecated, please use `vf-box--theme--primary` -->
<div class="vf-box vf-box--factoid">
<h3 class="vf-box__heading">Did You Know?</h3>
<p class="vf-box__text">Invasive cancer is the leading cause of death in the developed world and the second leading in the developing world.</p>
</div>
{% render '@vf-box--inlay', {
"component-type": "block",
"box": {
"box_heading": "About the Häring Group",
"box_text": "The Sharpe group brings together an interdisciplinary team of biologists, physicists and computer scientists to build a multi-scale computer simulation of a paradigm of organogenesis – mammalian limb development.",
"box_modifier": "vf-box--inlay",
"deprecated_text": "vf-box--inlay is now deprecated, please use `vf-box--theme--quaternary`"
}
} %}
The Sharpe group brings together an interdisciplinary team of biologists, physicists and computer scientists to build a multi-scale computer simulation of a paradigm of organogenesis – mammalian limb development.
<!-- vf-box--inlay is now deprecated, please use `vf-box--theme--quaternary` -->
<div class="vf-box vf-box--inlay">
<h3 class="vf-box__heading">About the Häring Group</h3>
<p class="vf-box__text">The Sharpe group brings together an interdisciplinary team of biologists, physicists and computer scientists to build a multi-scale computer simulation of a paradigm of organogenesis – mammalian limb development.</p>
</div>
vf-componenet-rollup
vf-core-components
vf-local-overrides
vf-sample
This page is part of the components section.