+
+
+ +
+
+ + + + +
+

Options

Definition of all available options for barba.init.

+

For a deep dive into the Barba Core class, please see the developer API.

+

Summary

    +
  1. Syntax
  2. +
  3. Definition
  4. +
+

Syntax

Here is short syntax of all options with their defaults.

+
1
2
3
4
5
6
7
8
9
10
11
12
13
barba.init({
cacheFirstPage: false,
cacheIgnore: false,
debug: false,
logLevel: 'off',
prefetchIgnore: false,
prevent: null,
preventRunning: false,
schema: [[SchemaAttribute]],
timeout: 2e3,
transitions: [],
views: [],
})
+ +

Definition

Barba can take some arguments in the initialization step:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cacheFirstPagebooleanDisable cache on the first rendered page, see cacheFirstPage strategy
cacheIgnoreIgnoreOptionDisable cache or ignore some routes, see cacheIgnore strategy
debugbooleanEnable debug mode
logLevelkeyof LogLevelsSet custom log level for fine-grained debugging
prefetchIgnoreIgnoreOptionDisable prefetch or ignore routes, see prefetchIgnore strategy
preventPreventCheckSet custom prevent check
preventRunningbooleanPrevent click when transition is running, see preventRunning strategy
requestErrorRequestCustomErrorSet custom request error
schemaISchemaAttributeSet custom schema to override data-barba attributes
timeoutnumberRequest timeout
transitionsITransitionPage[]Array of Transitions
viewsIView[]Array of Views
+
+

All arguments inherit from IBarbaOptions interface.

+
+ +
+ + + + + + + +
+ +
+
+