JavaScript
Use native HTML behavior where possible and import a runtime for components that need it.
Native controls
Button, Input, Checkbox, Radio group, and Accordion use native controls. Radio group includes the selection module for the moving highlight. The shared CSS styles them and the browser supplies their basic interactions.
Connect a form to your API
Keep a name on each submitted field. Set the copied form’s action to your endpoint for a native submission. For an inline update, attach a submit listener to the form in HTML, use onSubmit in React, or use @submit in Vue. Prevent the native submit before awaiting the request. For a CSV import, intercept only the Import CSV submitter so the Preview CSV action still runs.
const form = document.querySelector('[data-ilui-compose]');
const status = document.querySelector('#message-status');
form.addEventListener('submit', async event => {
event.preventDefault();
if (form.getAttribute('aria-busy') === 'true') return;
const submitter = event.submitter;
const body = new FormData(form, submitter);
form.setAttribute('aria-busy', 'true');
if (submitter) submitter.disabled = true;
status.textContent = 'Sending…';
try {
const response = await fetch('/api/messages', { method: 'POST', body });
if (!response.ok) throw new Error('Message could not be sent');
form.reset();
status.textContent = 'Message sent.';
} catch {
status.textContent = 'Could not send the message. Try again.';
} finally {
form.removeAttribute('aria-busy');
if (submitter) submitter.disabled = false;
}
});Add <p id="message-status" role="status"></p> beside the form. Replace /api/messages with your route. The server should validate the payload, authenticate the request, and apply your app’s CSRF protection where required.
Supply your own data
Render list and card markup from your application records. Preserve runtime attributes and give each item a stable key. For HTML copies, give each instance unique IDs and update the labels and ARIA references that point to them. The React and Vue samples generate per-instance IDs.
Use the Filterable table row event, the Analytics panel metric values, or the data bindings in Line charts and Area charts to update an existing view.
Handle component actions
Use the Integration notes on each example for the event name and payload. Cancelable events let your app hold off a local update while it persists a change, as in Kanban and People & access. For AI Chat, provide your own reply with event.detail.respondWith().
Connect a data table to your app
The Data Table examples run with local rows. Use these hooks when you want to connect them to your app.
Load rows from an endpoint
In Loading results or Error and retry, set data-ilui-table-request-url to your endpoint. It receives a GET request and should return an array of records with project, status, and owner strings. These variants show loading, empty, and retry states.
Persist row actions
Listen for ilui:table-before-archive on the table example. Call preventDefault() before awaiting your request. Read the selected project names from event.detail.projects and update your rows once the request succeeds. The default local archive path emits ilui:table-archive after updating the table.
Make a column optional
For a visibility toggle in Columns and actions, use the same data-ilui-table-column value on the header and cells and data-ilui-table-column-toggle on the checkbox. The shared runtime searches Project, Status, and Owner and sorts Project and Status.
Dialog runtime
The Dialog snippets include this side-effect import. The module handles triggers in the document, opens the matching native dialog, and restores focus to the trigger on close.
import "./inlay-assets/dialog.js";When wiring up your application action, listen for the dialog’s close event and check its returnValue. Use the trigger’s aria-controls to connect it to a unique dialog ID.