# Yahoo! UI Library

### yui 3.3.0

Yahoo! UI Library > yui > config
Search:
Filters Show Private Show Protected Show Deprecated

## `static` Class config

The config object contains all of the configuration options for the YUI instance. This object is supplied by the implementer when instantiating a YUI instance. Some properties have default values if they are not supplied by the implementer. This should not be updated directly because some values are cached. Use applyConfig() to update the config object on a YUI instance that has already been configured.

### Properties

#### 2in3 - `string`

The 2in3 project is a deployment of the various versions of YUI 2 deployed as first-class YUI 3 modules. Eventually, the wrapper for the modules will change (but the underlying YUI 2 code will be the same), and you can select a particular version of the wrapper modules via this config.
Default Value: 1

#### base - `string`

Base directory for dynamic loading

#### bootstrap - `boolean`

Allows the YUI seed file to fetch the loader component and library metadata to dynamically load additional dependencies.
Default Value: true

#### cacheUse - `boolean`

Cache serviced use() requests.
Default Value: true

#### combine - `boolean`

Use the YUI combo service to reduce the number of http connections required to load your dependencies. Turning this off will disable combo handling for YUI and all module groups configured with a combo service. For dynamic loading.
Default Value: true if 'base' is not supplied, false if it is.

#### comboBase - `string`

The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo? For dynamic loading.

#### core - `string[]`

A list of modules that defines the YUI core (overrides the default).

#### cssAttributes - `string`

Object literal containing attributes to add to dynamically loaded link nodes.

#### dateFormat - `string`

The default date format
Deprecated: use configuration in DataType.Date.format() instead.

#### doc - `Document`

The document associated with the 'win' configuration.
Default Value: the document hosting YUI

#### errorFn - `Function`

A callback to execute when Y.error is called. It receives the error message and an javascript error object if Y.error was executed because a javascript error was caught. The function is executed in the YUI instance context.

#### fetchCSS - `boolean|string`

Specifies whether or not YUI().use(...) will attempt to load CSS resources at all. Any truthy value will cause CSS dependencies to load when fetching script. The special value 'force' will cause CSS dependencies to be loaded even if no script is needed.
Default Value: true

#### filter - `string|object`

A filter to apply to result urls. This filter will modify the default path for all modules. The default path for the YUI library is the minified version of the files (e.g., event-min.js). The filter property can be a predefined filter or a custom filter. The valid predefined filters are:

DEBUG
  Selects the debug versions of the library (e.g., event-debug.js). This option will automatically include the Logger widget
RAW
  Selects the non-minified version of the library (e.g., event.js).

You can also define a custom filter, which must be an object literal containing a search expression and a replace string:

    myFilter: {
    'searchExp': "-min\\.js",
    'replaceStr': "-debug.js"
    }

For dynamic loading.

#### filters - `object`

Hash of per-component filter specification. If specified for a given component, this overrides the filter config. For dynamic loading.

#### force - `string[]`

A list of modules that should always be loaded when required, even if already present on the page.

#### gallery - `string`

The default gallery version to build gallery module urls

#### ignore - `string[]`

A list of modules that should never be dynamically loaded

#### injected - `boolean`

Set to true if the yui seed file was dynamically loaded in order to bootstrap components relying on the window load event and the 'domready' custom event.
Default Value: false

#### insertBefore - `string`

Node or id for a node that should be used as the insertion point for new nodes. For dynamic loading.

#### jsAttributes - `string`

Object literal containing attributes to add to dynamically loaded script nodes.

#### lang - `string|string[]`

A list of languages in order of preference. This list is matched against the list of available languages in modules that the YUI instance uses to determine the best possible localization of language sensitive modules. Languages are represented using BCP 47 language tags, such as "en-GB" for English as used in the United Kingdom, or "zh-Hans-CN" for simplified Chinese as used in China. The list can be provided as a comma-separated list or as an array.

#### loaderPath - `string`

The loader 'path' attribute to the loader itself. This is combined with the 'base' attribute to dynamically load the loader component when boostrapping with the get utility alone.
Default Value: loader/loader-min.js

#### loadErrorFn - `Function`

A callback to execute when the loader fails to load one or more resource. This could be because of a script load failure. It can also fail if a javascript module fails to register itself, but only when the 'requireRegistration' is true. If this function is defined, the use() callback will only be called when the loader succeeds, otherwise it always executes unless there was a javascript error when attaching a module.

#### locale - `string`

The default locale
Deprecated: use config.lang instead.

#### logExclude - `object`

A hash of log sources that should be not be logged. If specified, all sources are logged if not on this list.

#### logFn - `Function`

Alternative console log function for use in environments without a supported native console. The function is executed in the YUI instance context.

#### logInclude - `object`

A hash of log sources that should be logged. If specified, only log messages from these sources will be logged.

#### modules - `object`

A hash of module definitions to add to the list of YUI components. These components can then be dynamically loaded side by side with YUI via the use() method. This is a hash, the key is the module name, and the value is an object literal specifying the metdata for the module. * See Loader.addModule for the supported module metadata fields. Also @see groups, which provides a way to configure the base and combo spec for a set of modules. `modules: { mymod1: { requires: ['node'], fullpath: 'http://myserver.mydomain.com/mymod1/mymod1.js' }, mymod2: { requires: ['mymod1'], fullpath: 'http://myserver.mydomain.com/mymod2/mymod2.js' } }`

#### onCSS - `function`

Callback for the 'CSSComplete' event. When dynamically loading YUI components with CSS, this property fires when the CSS is finished loading but script loading is still ongoing. This provides an opportunity to enhance the presentation of a loading page a little bit before the entire loading process is done.

#### pollInterval - `int`

The default interval when polling in milliseconds.
Default Value: 20

#### purgethreshold - `int`

The number of dynamic nodes to insert by default before automatically removing them. This applies to script nodes because remove the node will not make the evaluated script unavailable. Dynamic CSS is not auto purged, because removing a linked style sheet will also remove the style definitions.
Default Value: 20

#### requireRegistration - `boolean`

When set to true, the YUI loader will expect that all modules it is responsible for loading will be first-class YUI modules that register themselves with the YUI global. If this is set to true, loader will fail if the module registration fails to happen after the script is loaded.
Default Value: false

#### rls - `object`

The parameter defaults for the remote loader service. Requires the rls submodule. The properties that are supported:

    m: comma separated list of module requirements.  This
    must be the param name even for custom implemetations.
    v: the version of YUI to load.  Defaults to the version
    of YUI that is being used.
    gv: the version of the gallery to load (@see the gallery config)
    env: comma separated list of modules already on the page.
    this must be the param name even for custom implemetations.
    lang: the languages supported on the page (@see the lang config)
    '2in3v':  the version of the 2in3 wrapper to use (@see the 2in3 config).
    '2v': the version of yui2 to use in the yui 2in3 wrappers
    (@see the yui2 config)
    filt: a filter def to apply to the urls (@see the filter config).
    filts: a list of custom filters to apply per module
    (@see the filters config).
    tests: this is a map of conditional module test function id keys
    with the values of 1 if the test passes, 0 if not.  This must be
    the name of the querystring param in custom templates.

#### rls_base - `object`

The base path to the remote loader service

#### rls_tmpl - `object`

The template to use for building the querystring portion of the remote loader service url. The default is determined by the rls config -- each property that has a value will be represented. ex: m={m}&v={v}&env={env}&lang={lang}&filt={filt}&tests={tests}

#### root - `string`

The root path to prepend to module path for the combo service. Ex: 3.0.0b1/build/ For dynamic loading.

#### skin - `object`

The 'skin' config let's you configure application level skin customizations. It contains the following attributes which can be specified to override the defaults: // The default skin, which is automatically applied if not // overriden by a component-specific skin definition. // Change this in to apply a different skin globally defaultSkin: 'sam', // This is combined with the loader base property to get // the default root directory for a skin. base: 'assets/skins/', // Any component-specific overrides can be specified here, // making it possible to load different skins for different // components. It is possible to load more than one skin // for a given component as well. overrides: { slider: ['capsule', 'round'] } For dynamic loading.

#### throwFail - `boolean`

If throwFail is set, Y.error will generate or re-throw a JS Error. Otherwise the failure is logged.
Default Value: true

#### timeout - `int`

Number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout.

#### use_rls - `object`

Configure the instance to use a remote loader service instead of the client loader.

#### useBrowserConsole - `boolean`

Log to the browser console if debug is on and the browser has a supported console.
Default Value: true

#### useHistoryHTML5 - `boolean`

If `true`, the `Y.History` alias will always point to `Y.HistoryHTML5` when the history-html5 module is loaded, even if the current browser doesn't support HTML5 history.

If `false`, the `Y.History` alias will always point to `Y.HistoryHash` when the history-hash module is loaded, even if the current browser supports HTML5 history.

If neither `true` nor `false`, the `Y.History` alias will point to the best available history adapter that the browser supports. This is the default behavior.

#### win - `Window`

The window/frame that this instance should operate in.
Default Value: the window hosting YUI

#### windowResizeDelay - `int`

The default interval when polling in milliseconds.
Default Value: 40

#### yui2 - `string`

The default YUI 2 version to build yui2 module urls. This is for intrinsic YUI 2 support via the 2in3 project. Also @see the '2in3' config for pulling different revisions of the wrapped YUI 2 modules.
Default Value: 2.8.1

Copyright © 2011 Yahoo! Inc. All rights reserved.