Skip to content

Cta

<ns-cta>

Overview

A call-to-action allows users to take action once they are ready for it.

Users can perform particular actions through the use of the ns-cta component. An example of these actions could be to submit a form through an event (i.e. a click event) or navigate with a hyperlink.

There is no distinction between a hyperlink or an action through the design of the ns-cta component. Use its textual content to convey the intent of the CTA to the user.

Examples

Guidance

Standard

Labelled diagram of ns-cta

Key

KeyField typeGuidelines
ATextKeep the text ‘short, relevant, and actionable’. It should not exceed more than 24 characters.
BIconThis is a decoration. It is intended to imply direction such as moving forwards and backwards in a journey. The specification has a list of options.

Implementation

Placement

The ns-cta component can be used in the following components:

Specification

Attributes

href

Property
href
Type
string

loading

Property
loading
Description
Whether the CTA is in a loading state.
Type
boolean
Default
false

loading-message

Property
loadingMessage
Description
The message to display when the CTA is in a loading state. Defaults to 'Loading...'.
Type
string
Default
Loading...

disabled

Property
disabled
Type
Default
false

icon

Property
icon
Type
string
Options
Refer to our icons.
Default
arrow-right

type

Property
type
Description
The type of the CTA.
Type
string
Options
direct text submit reset
Default
direct

Slots

SlotPermitted tagsDescription
Anonymous slotAnonymous slot for content.

Events

NameDescription
clickDispatched when the CTA is clicked.

Specification notes

Icons

They are decorative, not descriptive, and are there to supplement the text.

href
  • Can be used instead of having a wrapping <a> element.
  • This shouldn’t be used if a click event is added.

Last updated: