Anchor Design System

Progress indicator3.0

The Progress Indicator is a component that shows the user the steps they need to take to complete a form.

Installation

npm i @tryg/ui-library

Usage

Individual only imports the desired component, and only needs to be included once within the application. Which is beneficial to keep the application size small.

Webcomponent
<script type="module">
  import { defineCustomElement as defineCustomProgressIndicator } from '@tryg/ui-library/dist/components/anchor-progress-indicator';
  defineCustomProgressIndicator();
  import { defineCustomElement as defineCustomProgressStepIndicator } from '@tryg/ui-library/dist/components/anchorr-progress-indicator-step';
  defineCustomProgressStepIndicator();
</script>
<anchor-progress-indicator current-index="2">
  <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
  <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
  <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
  <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

Global only needs to be defined once in the application, but it will import all components even the ones that are not in use..

Webcomponent
<script type="module">
  import { defineCustomElements } from '@tryg/ui-library/dist/loader';
  defineCustomElements();
</script>
<anchor-progress-indicator current-index="1">
  <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
  <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
  <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
  <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

The Progress Indicator is a component that shows the user the steps they need to take to complete a form. It is a visual representation of the steps in a process, and it can be used to guide the user through a form or to show the user how far they have come in a survey.

Alternative labels

<anchor-progress-indicator current-index="2" alt-labels>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

Hide labels

<anchor-progress-indicator current-index="2" hide-labels>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

Is advancing

<anchor-progress-indicator current-index="2" is-advancing>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

Is continuing

<anchor-progress-indicator current-index="2" is-continuing>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

Small

<anchor-progress-indicator current-index="2" size="small">
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

Vertical orientation

<anchor-progress-indicator current-index="2" orientation="vertical">
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
</anchor-progress-indicator>

API

Progress indicator

anchor-progress-indicator

Properties

PropertyAttributeDescriptionTypeDefault
altLabelsalt-labelsUse alternative labels for the stepsbooleanfalse
currentIndexcurrent-indexWhich index is this step in the progress indicatornumber0
hideLabelshide-labelsHide the labels for the stepsbooleanfalse
isAdvancingis-advancingIs advancing the progress indicator flowbooleanfalse
isContinuingis-continuingIs continuing the progress indicator flowbooleanfalse
orientationorientationOrientation of the progress-indicator component"horizontal" | "vertical"'horizontal'
sizesizeSize of the progress-indicator component and it's steps"normal" | "small"'normal'

Dependencies

Depends on

Graph


Built with StencilJS

Progress indicator step

anchor-progress-indicator-step

Properties

PropertyAttributeDescriptionTypeDefault
activeactiveIs this step activebooleanfalse
altLabelsalt-labelsUse alternative labels for the stepbooleanfalse
completedcompletedIs this step completebooleanfalse
disableddisabledIs this step disabledbooleanfalse
hideLabelshide-labelsHide the label for the stepbooleanfalse
indexindexWhich index is this step in the progress indicatornumber0
isFirstis-firstIs this the first stepbooleanfalse
isLastis-lastIs this the last stepbooleanfalse
labellabelLabel for the stepstringundefined
orientationorientationOrientation of the step component"horizontal" | "vertical"'vertical'
sizesizeSize of the step component"normal" | "small"'normal'

Events

EventDescriptionType
clickCustomEvent<any>

Dependencies

Depends on

Graph


Built with StencilJS

On this page