Settings

oziConf() is optional — without it, ozi-ui works with default values (default theme, en language, all plugins loaded).

Call oziConf() right after including ozi.js:

<script src="/plugins/ozi-ui/ozi.js"></script>
<script>
    oziConf({ ... });
</script>

Minimal configuration

Most projects only need to set the theme and language:

oziConf({
    theme: 'bootstrap5',
    lang:  'en'
});

Themes

Theme When to use
default Projects with custom CSS or no UI framework
bootstrap5 Projects with Bootstrap 5 — recommended default
tailwind Projects with Tailwind CSS
oziConf({ theme: 'bootstrap5' });

The theme defines the classMap — the CSS classes applied by ozi-ui for validation states, buttons and visual feedback. See the classMap section to customize.


Languages

Value Language
en English — default
pt-BR Brazilian Portuguese
oziConf({
    lang:         'en',
    fallbackLang: 'en'  // used when a key doesn't exist in the main language
});

Plugins — load only what you need

By default ozi-ui loads all plugins. To load only the necessary ones:

oziConf({
    plugins: ['loaddata', 'select', 'toggle']
});

Dependencies are resolved automatically — no need to declare internal modules.

Available plugins

Plugin Category
loaddata module
select component
autocomplete component
editor component
audio component
auth component
check component
search component
copy behavior
toggle behavior

Full configuration

oziConf({

    // ── Theme and visual mode ───────────────────
    theme:     'bootstrap5',  // 'default' | 'bootstrap5' | 'tailwind'
    themeMode: 'auto',        // 'light' | 'dark' | 'auto'

    // ── Language ────────────────────────────────
    lang:         'en',
    fallbackLang: 'en',

    // ── Plugins to load ─────────────────────────
    plugins: 'all',  // 'all' or array: ['loaddata', 'select', ...]

    // ── Core ────────────────────────────────────
    core: {
        urlBase:  './plugins/ozi-ui/',  // base path of the files
        log:      false,                // debug logs in the console
        failFast: false                 // stops boot on first error
    },

    // ── Per-plugin configuration ─────────────────
    pluginConf: {

        loaddata: {
            progressBarGlobalClass: 'ozi-progress',
            interactiveValidation:  true   // validates fields on blur
        },

        select: {
            imageDimension: '24px',   // default size of images in options
            autoObserve:    false     // detects new elements via MutationObserver
        },

        autocomplete: {
            autoObserve: false
        },

        editor: {
            uicolor: 'var(--ozi-color-primary)'  // color of active buttons and focus border
        },

        audio: {
            autoObserve: false
        },

        auth: {
            passMin:      12,  // minimum password characters
            passMax:      64,  // maximum password characters
            userCaracter:  4   // minimum characters in the username field
        }
    },

    // ── classMap — overrides the theme preset ───
    classMap: {
        invalid:       'is-invalid',
        valid:         'is-valid',
        formValidated: 'was-validated',
        feedback:      'invalid-feedback',
        button:        'btn btn-primary',
        disabled:      'disabled'
    }

});

Reference

core

Parameter Default Description
urlBase './plugins/ozi-ui/' Base path where ozi-ui files are served
log false Enables detailed logs in the console
failFast false Stops boot on first loading error

pluginConf

loaddata

Parameter Default Description
progressBarGlobalClass 'ozi-progress' CSS class of the global progress bar
interactiveValidation true Validates fields individually on blur

select

Parameter Default Description
imageDimension '24px' Default size of images displayed in options
autoObserve false Automatically initializes new elements via MutationObserver

autocomplete

Parameter Default Description
autoObserve false Automatically initializes new elements via MutationObserver

editor

Parameter Default Description
uicolor 'var(--ozi-color-primary)' Color applied to active buttons and focus border

audio

Parameter Default Description
autoObserve false Automatically initializes new elements via MutationObserver

auth

Parameter Default Description
passMin 12 Minimum accepted password characters
passMax 64 Maximum accepted password characters
userCaracter 4 Minimum characters in the username field

classMap

Mapping of semantic tokens to UI framework CSS classes. Automatically populated by the theme preset — override only what is necessary.

Bootstrap 5 (bootstrap5 theme default)

Token Value
invalid 'is-invalid'
valid 'is-valid'
formValidated 'was-validated'
feedback 'invalid-feedback'
button 'btn btn-primary'
disabled 'disabled'

Tailwind (tailwind theme)

Token Value
invalid 'border-red-500 text-red-600'
valid 'border-green-500 text-green-600'
formValidated 'ozi-validated'
feedback 'text-red-500 text-sm mt-1'
button 'px-4 py-2 bg-blue-600 text-white rounded'
disabled 'opacity-50 cursor-not-allowed'

Partial override

To adjust only one token without changing the theme:

oziConf({
    theme: 'bootstrap5',
    classMap: {
        button: 'btn btn-danger'  // only this changes — the rest comes from the preset
    }
});