Back to overview

INtex WebComponents and their usage

Developer Tutorials Published on 03.03.2026

INtex Web Components Documentation

A guide to using the custom web components for building powerful user interfaces within the INtex Projekt X framework.

IntexUI - Global UI Controller

The global intex object provides methods for common UI tasks like dialogs, toasts, and loading indicators. It is available on every page where intexui.js is included.

intex.confirm()

Displays a modal confirmation dialog. It returns a Promise that resolves to true if the user confirms, or false if they cancel.

ParameterTypeDescription
messagestringThe main text to display in the dialog.
optionsobject(Optional) An object with configuration properties.
options.titlestringThe dialog title. Default: "Information".
options.btnOkstringText for the confirmation button. Default: "OK".
options.btnCancelstringText for the cancel button. Default: "Cancel".
options.colorstringA hex color for the header and OK button. Default: Accent color.
options.iconstringA Font Awesome icon class (e.g., 'fa-trash-can').
options.widthstringThe maximum width of the modal (e.g., '600px').
options.preConfirmfunctionAn async function that runs before confirming. If it returns false, the dialog remains open.
Example: Simple Confirmation

if (await intex.confirm("Are you sure you want to proceed?")) {
    // User clicked "OK"
    console.log("Action confirmed.");
}
                            
Example: Delete Confirmation

const confirmed = await intex.confirm(
    "This will permanently delete the record.",
    {
        title: "Delete Record",
        btnOk: "Yes, delete",
        color: "#dc3545", // Red for danger
        icon: "fa-triangle-exclamation"
    }
);
if (confirmed) { /* ... */ }
                            

intex.toast()

Shows a short-lived notification message (toast) at the top-right of the screen.

ParameterTypeDescription
messagestringThe text to display.
typestring(Optional) The style of the toast: 'success', 'danger', 'warning', or 'info'. Default: 'success'.
delaynumber(Optional) Duration in milliseconds before the toast fades. Default: 5000.
Example

intex.toast("Record saved successfully!", "success");
intex.toast("Could not connect to server.", "danger");
                            

intex.showLoading()

Displays or hides a full-screen loading overlay.

Example

// Show the loader
intex.showLoading(true, "Processing data...");

// Hide the loader after some work is done
setTimeout(() => {
    intex.showLoading(false);
}, 2000);
                            

<intex-datepicker>

A modern, theme-aware date and datetime picker component.

Attributes

AttributeDescriptionExample
valueThe current value in ISO format (YYYY-MM-DD or YYYY-MM-DD HH:mm).value="2024-12-31 14:30"
modeSet to 'date' or 'datetime'. Default is 'date'.mode="datetime"
langLanguage for localization ('de' or 'en'). Default: 'de'.lang="en"
accent-colorOverrides the default accent color with a specific hex value.accent-color="#e67e22"

Events

The component dispatches a change event when a new date or time is selected. The new value is available in event.detail.

Usage Example

For form submissions, it's best practice to pair the datepicker with a hidden input that stores the ISO-formatted value.


<!-- In your form -->
<div class="mb-3">
    <label for="my-date-picker" class="form-label">Appointment Date</label>
    
    <!-- The component for the user -->
    <intex-datepicker id="my-date-picker" mode="datetime" value="2024-08-15 10:00"></intex-datepicker>
    
    <!-- The hidden input that gets submitted -->
    <input type="hidden" name="appointment_date" id="my-date-value" value="2024-08-15 10:00">
</div>

<script>
    const picker = document.getElementById('my-date-picker');
    const hiddenInput = document.getElementById('my-date-value');
    
    picker.addEventListener('change', (event) => {
        hiddenInput.value = event.detail;
    });
</script>
                            

<intex-dropzone>

A drag-and-drop file upload component that integrates seamlessly with standard forms.

Important: This component works by wrapping a standard <input type="file">, which you must place inside it in your HTML. This ensures native form submission compatibility.

Attributes

AttributeDescription
labelThe main label text displayed above the dropzone.
nameThe name for the file input, used in form submission.
acceptA string defining the file types the file input should accept (e.g., 'image/*, .pdf').
current-file-urlURL to an already uploaded file to display it.
current-file-nameDisplay name for the current file.
max-sizeMaximum file size in megabytes (e.g., '5'). Default: 5.
max-filesMaximum number of files allowed. Default: 1.
requiredMakes the file input a required field in the form.
disabledDisables the component.
errorDisplays an error message below the component.

Usage Example

The component requires a standard file input and a hidden input for the delete flag inside its light DOM.


<!-- Example for a new upload -->
<intex-dropzone label="Upload Profile Picture" name="profile_pic" accept="image/png, image/jpeg">
    <!-- This input is controlled by the component -->
    <input type="file" name="profile_pic">
</intex-dropzone>

<!-- Example with an existing file -->
<intex-dropzone 
    label="Contract Document" 
    name="contract_file" 
    current-file-url="/files/contract.pdf" 
    current-file-name="Contract_2024.pdf">
    
    <!-- The file input for a new upload -->
    <input type="file" name="contract_file">
    
    <!-- Hidden input to signal deletion on the server -->
    <input type="hidden" name="delete_file_contract" value="0">
</intex-dropzone>

<script>
    // Script to connect the delete checkbox to the hidden input
    document.querySelector('intex-dropzone[name="contract_file"]').addEventListener('delete-change', (e) => {
        const hiddenInput = document.querySelector('input[name="delete_file_contract"]');
        if (hiddenInput) {
            hiddenInput.value = e.detail ? '1' : '0';
        }
    });
</script>
                            

<intex-editor>

A lightweight, theme-aware WYSIWYG editor.

Important: The editor's content is not part of the standard form submission. You must use JavaScript to sync its content with a hidden <textarea>.

Attributes

AttributeDescription
configDefines the toolbar complexity: 'light', 'normal', or 'pro'. Default: 'normal'.
placeholdersA JSON string of an array of objects ([{label: "User", value: "{user.name}"}]) to populate the placeholder dropdown.
usernameThe current user's name, used for the 'Insert Username' context menu action.
langLanguage for tooltips ('de' or 'en'). Default: 'de'.

Properties & Events

  • Property: .value: Get or set the editor's HTML content programmatically.
  • Event: input: Fires whenever the content inside the editor changes.

Usage Example

Always pair the editor with a textarea to ensure the content is submitted with the form.


<div class="mb-3">
    <label class="form-label">Product Description</label>
    
    <!-- The hidden textarea that gets submitted -->
    <textarea name="description" id="description-source" class="d-none">
        <p>Initial <b>HTML</b> content.</p>
    </textarea>
    
    <!-- The editor component for the user -->
    <intex-editor id="description-editor" config="pro"></intex-editor>
</div>

<script>
    const editor = document.getElementById('description-editor');
    const source = document.getElementById('description-source');

    // 1. Set initial value from textarea
    editor.value = source.value;

    // 2. Sync editor content back to textarea on change
    editor.addEventListener('input', () => {
        source.value = editor.value;
    });
</script>