Skip to content

UiLogBarRenderer

Viames Marino edited this page May 10, 2026 · 1 revision

Pair framework: UiLogBarRenderer

Pair\Html\UiLogBarRenderer is an optional renderer contract for LogBar-specific UI chrome.

It lets UI renderer implementations control the outer LogBar classes and whether the LogBar can show named framework breakpoints.

When to implement

Implement UiLogBarRenderer when a custom UiRenderer needs framework-specific LogBar wrappers.

If a renderer does not implement it, UiTheme falls back to the native LogBar chrome.

Methods

logBarChromeClasses(): array

Returns the classes used by the LogBar shell.

The array contains:

  • root
  • header
  • body

Example:

use Pair\Html\UiLogBarRenderer;
use Pair\Html\UiRenderers\NativeUiRenderer;

final class TailwindRenderer extends NativeUiRenderer implements UiLogBarRenderer {

    /**
     * Return the renderer name used by UiTheme.
     */
    public function name(): string
    {
        return 'tailwind';
    }

    /**
     * Return Tailwind-compatible LogBar classes.
     */
    public function logBarChromeClasses(): array
    {
        return [
            'root' => 'logbar rounded border',
            'header' => 'logbar-header border-b',
            'body' => 'p-4',
        ];
    }

    /**
     * Return whether this renderer exposes named breakpoints.
     */
    public function supportsLogBarBreakpoints(): bool
    {
        return false;
    }

}

supportsLogBarBreakpoints(): bool

Returns whether the renderer has named framework breakpoints that the LogBar can display.

The built-in Bootstrap and Bulma renderers return true. Native HTML returns false.

Framework behavior

LogBar asks UiTheme for LogBar chrome. UiTheme checks the active renderer and uses UiLogBarRenderer when available.

This keeps LogBar markup out of the generic renderer contract while still allowing framework-specific output.

See also: UiRenderer, UiTheme, LogBar, Application.

Clone this wiki locally