Search results

Overflow Mode in Breadcrumb in Vue Breadcrumb component

22 Sep 2022 / 5 minutes to read

In the Breadcrumb component, maxItems and overflowMode properties were used to limit the number of breadcrumb items to be displayed.

In the following example, the maxItems is set as 3 with overflowMode as Default. To prevent breadcrumb item navigation, the enableNavigation property has been set to false in the Breadcrumb component.

Source
Preview
app.vue
Copied to clipboard
<template>
<div>
<ejs-breadcrumb maxItems='3' :enableNavigation='false' :separatorTemplate="separatorTemplate">
  <e-breadcrumb-items>
    <e-breadcrumb-item text= 'Home' url= '../'></e-breadcrumb-item>
    <e-breadcrumb-item text= 'Breadcrumb' url= './breadcrumb'></e-breadcrumb-item>
    <e-breadcrumb-item text= 'Default' url= './breadcrumb/default'></e-breadcrumb-item>
    <e-breadcrumb-item text= 'Icons' url= './breadcrumb/icons'></e-breadcrumb-item>
    <e-breadcrumb-item text= 'Navigations' url= './breadcrumb/navigations'></e-breadcrumb-item>
    <e-breadcrumb-item text= 'Overflow' url= './breadcrumb/overflow'></e-breadcrumb-item>
  </e-breadcrumb-items>
</ejs-breadcrumb>
</div>
</template>

<script>
import Vue from 'vue';
import { BreadcrumbPlugin } from "@syncfusion/ej2-vue-navigations";

Vue.use(BreadcrumbPlugin);


export default {
  data: function() {
    return {
    separatorTemplate: '<span class="e-bicons e-arrow"></span>',
    };
  }
}
</script>

<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";

body {
  margin-top: 100px;
  text-align: center;
}

@font-face {
  font-family: 'e-bicons';
  src:
  url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj1wSfkAAAEoAAAAVmNtYXDnHOdpAAABmAAAAD5nbHlmSRvkRAAAAegAAANoaGVhZB2Xb78AAADQAAAANmhoZWEIUQQHAAAArAAAACRobXR4GAAAAAAAAYAAAAAYbG9jYQSCAv4AAAHYAAAADm1heHABFwEfAAABCA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G4AIAAxAC4AMABlAC0AYgBjAG8AbgBzAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAHUAcwBpAG4AZwAgAFMAeQBuAGMAZgB1AHMAaQBvAG4AIABNAGUAdAByAG8AIABTAHQAdQBkAGkAbwB3AHcAdwAuAHMAeQBuAGMAZgB1AHMAaQBvAG4ALgBjAG8AbQAAAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAgEDAQQBBQEGAQcAE2RvY3VtZW50LXNldHRpbmctd2YOZm9sZGVyLW9wZW4tMDERY2hldnJvbi1yaWdodF8wMy0KY2hlY2stbWFyawhob3VzZS0wNAAAAAA=) format('truetype');
  font-weight: normal;
  font-style: normal;
}

.e-bicons {
  font-family: 'e-bicons' !important;
  font-size: 14px;
}

.e-breadcrumb .e-breadcrumb-separator + .e-breadcrumb-separator {
  padding-left: 0;
  margin-left: -8px;
}

.e-bicons.e-arrow {
  margin-top: -2px;
}

.e-arrow:before {
  content: "\e706";
  font-weight: 800;
  font-size: 9px;
}
</style>

The following overflow modes are available in the Breadcrumb component.

  • Collapsed
  • Menu
  • Wrap
  • Scroll
  • Hidden
  • None

Collapsed

Collapsed mode shows the first and last Breadcrumb items and hides the remaining items with a collapsed icon. When the collapsed icon is clicked, all items become visible and navigable.

Source
Preview
app.vue
Copied to clipboard
<template>
<div>
<ejs-breadcrumb maxItems='3' :enableNavigation='false' overflowMode="Collapsed">
  <e-breadcrumb-items>
<e-breadcrumb-item text= 'Home' url= '../'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Breadcrumb' url= './breadcrumb'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Default' url= './breadcrumb/default'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Icons' url= './breadcrumb/icons'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Navigations' url= './breadcrumb/navigations'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Overflow' url= './breadcrumb/overflow'></e-breadcrumb-item>
  </e-breadcrumb-items>
</ejs-breadcrumb>
</div>
</template>

<script>
import Vue from 'vue';
import { BreadcrumbPlugin } from "@syncfusion/ej2-vue-navigations";

Vue.use(BreadcrumbPlugin);


export default {
  data: function() {
return {
};
  }
}
</script>

<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";

body {
  margin-top: 100px;
  text-align: center;
}

</style>

Menu mode shows the number of Breadcrumb items that can be accommodated within the container space and creates a submenu with the remaining items.

Source
Preview
app.vue
Copied to clipboard
<template>
<div>
<ejs-breadcrumb maxItems='3' :enableNavigation='false' overflowMode="Menu">
  <e-breadcrumb-items>
<e-breadcrumb-item text= 'Home' url= '../'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Breadcrumb' url= './breadcrumb'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Default' url= './breadcrumb/default'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Icons' url= './breadcrumb/icons'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Navigations' url= './breadcrumb/navigations'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Overflow' url= './breadcrumb/overflow'></e-breadcrumb-item>
  </e-breadcrumb-items>
</ejs-breadcrumb>
</div>
</template>

<script>
import Vue from 'vue';
import { BreadcrumbPlugin } from "@syncfusion/ej2-vue-navigations";

Vue.use(BreadcrumbPlugin);


export default {
  data: function() {
return {
};
  }
}
</script>

<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";

body {
  margin-top: 100px;
  text-align: center;
}

</style>

Wrap

Wrap mode wraps the items to multiple lines when the Breadcrumb’s width exceeds the container space.

Source
Preview
app.vue
Copied to clipboard
<template>
<div>
<ejs-breadcrumb maxItems='3' :enableNavigation='false' overflowMode="Wrap">
  <e-breadcrumb-items>
<e-breadcrumb-item text= 'Home' url= '../'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Breadcrumb' url= './breadcrumb'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Default' url= './breadcrumb/default'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Icons' url= './breadcrumb/icons'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Navigations' url= './breadcrumb/navigations'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Overflow' url= './breadcrumb/overflow'></e-breadcrumb-item>
  </e-breadcrumb-items>
</ejs-breadcrumb>
</div>
</template>

<script>
import Vue from 'vue';
import { BreadcrumbPlugin } from "@syncfusion/ej2-vue-navigations";

Vue.use(BreadcrumbPlugin);


export default {
  data: function() {
return {
};
  }
}
</script>

<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";

body {
  margin-top: 100px;
  text-align: center;
}

</style>

Scroll

Scroll mode shows an HTML scroll bar when the Breadcrumb’s width exceeds the container space.

Source
Preview
app.vue
Copied to clipboard
<template>
<div>
<ejs-breadcrumb maxItems='3' :enableNavigation='false' overflowMode="Scroll">
  <e-breadcrumb-items>
<e-breadcrumb-item text= 'Home' url= '../'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Breadcrumb' url= './breadcrumb'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Default' url= './breadcrumb/default'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Icons' url= './breadcrumb/icons'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Navigations' url= './breadcrumb/navigations'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Overflow' url= './breadcrumb/overflow'></e-breadcrumb-item>
  </e-breadcrumb-items>
</ejs-breadcrumb>
</div>
</template>

<script>
import Vue from 'vue';
import { BreadcrumbPlugin } from "@syncfusion/ej2-vue-navigations";

Vue.use(BreadcrumbPlugin);


export default {
  data: function() {
return {
};
  }
}
</script>

<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";

body {
  margin-top: 100px;
  text-align: center;
}

</style>

Hidden

Hidden mode shows the maximum number of items possible in the container space and hides the remaining items. Clicking on a previous item will make the hidden item visible.

Source
Preview
app.vue
Copied to clipboard
<template>
<div>
<ejs-breadcrumb maxItems='3' :enableNavigation='false' overflowMode="Hidden">
  <e-breadcrumb-items>
<e-breadcrumb-item text= 'Home' url= '../'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Breadcrumb' url= './breadcrumb'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Default' url= './breadcrumb/default'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Icons' url= './breadcrumb/icons'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Navigations' url= './breadcrumb/navigations'></e-breadcrumb-item>
<e-breadcrumb-item text= 'Overflow' url= './breadcrumb/overflow'></e-breadcrumb-item>
  </e-breadcrumb-items>
</ejs-breadcrumb>
</div>
</template>

<script>
import Vue from 'vue';
import { BreadcrumbPlugin } from "@syncfusion/ej2-vue-navigations";

Vue.use(BreadcrumbPlugin);


export default {
  data: function() {
return {
};
  }
}
</script>

<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";

body {
  margin-top: 100px;
  text-align: center;
}

</style>

None

None mode shows all the items on a single line.