Skip to content

Navbar

The FTNavbar is used to help people navigate the site with breadcrumbs allowing users to navigate up one or multiple levels.

Usage

Composition api (script setup)

vue
<script setup lang="ts">
  import { FTNavbar } from '@fasttrack-solutions/vue-components-lib';
</script>
<script setup lang="ts">
  import { FTNavbar } from '@fasttrack-solutions/vue-components-lib';
</script>

Options api

vue
<script>
  import { FTNavbar } from '@fasttrack-solutions/vue-components-lib';
  export default {
    components: {
      FTNavbar
    }
  }
</script>
<script>
  import { FTNavbar } from '@fasttrack-solutions/vue-components-lib';
  export default {
    components: {
      FTNavbar
    }
  }
</script>

Buttons

vue
<script lang="ts" setup>
  const breadcrumbs = [
    {
      text: 'Contracts',
      type: 'link',
      link: { path: '/contracts' },
    },
    {
      text: 'Create new',
      type: 'text',
    },
  ];
</script>
<template>
  <FTNavbar :breadcrumbs="breadcrumbs"></FTNavbar>
</template>
<script lang="ts" setup>
  const breadcrumbs = [
    {
      text: 'Contracts',
      type: 'link',
      link: { path: '/contracts' },
    },
    {
      text: 'Create new',
      type: 'text',
    },
  ];
</script>
<template>
  <FTNavbar :breadcrumbs="breadcrumbs"></FTNavbar>
</template>

With Actions

Buttons

vue
<script lang="ts" setup>
  const breadcrumbs = [
    {
      text: 'Contracts',
      type: 'link',
      link: { path: '/contracts' },
    },
    {
      text: 'Create new',
      type: 'text',
    },
  ];

  const actions = [
    {
      text: 'Action button',
      type: 'button',
      callback: () => {
        alert('Click')
      },
    },
    {
      text: 'Action button',
      type: 'button',
      callback: () => {
        alert('Click')
      },
    },
  ];
</script>
<template>
  <FTNavbar :breadcrumbs="breadcrumbs" :actions="actions"></FTNavbar>
</template>
<script lang="ts" setup>
  const breadcrumbs = [
    {
      text: 'Contracts',
      type: 'link',
      link: { path: '/contracts' },
    },
    {
      text: 'Create new',
      type: 'text',
    },
  ];

  const actions = [
    {
      text: 'Action button',
      type: 'button',
      callback: () => {
        alert('Click')
      },
    },
    {
      text: 'Action button',
      type: 'button',
      callback: () => {
        alert('Click')
      },
    },
  ];
</script>
<template>
  <FTNavbar :breadcrumbs="breadcrumbs" :actions="actions"></FTNavbar>
</template>

Props

There are two props with breadcrumbs being required.

NameDefaultDescription
breadcrumbsFTBreadcrumb[]Display button in a loading state
actionsFTBreadcrumbAction[]Display button in a loading state

FTBreadcrumb

NameDefaultDescription
hiddenfalseDWhether the breadcrumb should be hidden
typetextThe type of breadcrumb. Possible values are options, link, or text
options[]An array of options for the breadcrumb dropdown menu (applicable only if type is options)
optionsButtonundefinedDisplay button in a loading state
optionsBadgeundefinedDisplay button in a loading state
callbackundefinedA callback function to be executed when the breadcrumb is clicked (applicable only if type is options or text)
textemptyThe text to be displayed for the breadcrumb.
linkundefinedThe route location for the breadcrumb (applicable only if type is link)

FTBreadcrumbAction

NameDefaultDescription
typefalseThe type of action. Possible values are icon or button
activefalseWhether the action is active
visibletrueWhether the action is visible
disabledfalseWhether the action is disabled
outlinedfalseWhether the action is outlined.
callbackundefinedA callback function to be executed when the breadcrumb is clicked (applicable only if type is options or text)

Slots

NameDescription
custom-actionA slot placed before action buttons