Jump to main content

Links


Links are used to embed actions or pathways to more information, allowing users to click their way from page to page.

Default

Default links are a color defined by $color-link and are 10% darker when already visited.

External

The .p-link--external class should be used on hyperlinks that go to a different domain than the current one.

Note:The `p-link--external` class makes use of the fairly new CSS Masks. For support in more browsers you should run your CSS through an autoprefixer before deploying.

Soft

The .p-link--soft class should be used on hyperlinks where many links are grouped together, such as a link cloud.

Inverted

The .p-link--inverted class should be used where links are placed on a dark background.

Back to top

The .p-top link can be used to make it easier to go back to the top on long pages. If the page is divided into different sections, you can use more than one per page.

New

The .p-link--skip link is used to help keyboard users navigate quickly to the main content of a page. It should be the first element that can be tabbed to on any page, and should reference either the <main> landmark region element, or the ID of an element that contains the main content of the page.

Import

To import just this component into your project, copy the snippet below and include it in your main Sass file.

// import Vanilla and include base mixins
// this only needs to happen once in a given project
@import 'vanilla-framework/scss/vanilla';
@include vf-base;

@include vf-p-links;

For more information see Customising Vanilla in your projects, which includes overrides and importing instructions.

React

You can use links in React by installing our react-component library and importing Link component.

See the documentation for our React Link component