LoadingRenderer
Custom loading renderer function. Returns an element or HTML string to display as the loading indicator.
Used with the loadingRenderer property in GridConfig to replace
the default spinner with custom content.
type LoadingRenderer = (context: LoadingContext) => HTMLElement | stringExample
Section titled “Example”// Simple text loading indicatorconst textLoader: LoadingRenderer = () => { const el = document.createElement('div'); el.textContent = 'Loading...'; return el;};
// Custom spinner with size awarenessconst customSpinner: LoadingRenderer = (ctx) => { const spinner = document.createElement('my-spinner'); spinner.size = ctx.size === 'large' ? 48 : 24; return spinner;};
// Material Design-style progress barconst progressBar: LoadingRenderer = () => { const container = document.createElement('div'); container.className = 'progress-bar-container'; container.innerHTML = '<div class="progress-bar"></div>'; return container;};
grid.gridConfig = { loadingRenderer: customSpinner,};See Also
Section titled “See Also”LoadingContextfor the context object passed to the rendererLoadingSizefor size variants (‘large’ | ‘small’)
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt