CSS hooks
data-page identifies a page, data-component identifies a reusable component, and data-slot identifies a part of that component.
Custom CSS
Pages
The<body> element has one of these data-page values:
Components and slots
Components may be absent when their feature is disabled or they have no content.
Repeated records also expose their database key separately through
data-component-id, data-component-group-id,
data-incident-id, data-metric-id, data-schedule-id, or data-update-id. Use those attributes only when a theme
must target one configured record.
Incident-day components expose their ISO date through data-date.
The subscribe component exposes data-state="form", subscribed, unsubscribed, or verified on its state slot.
Render hooks
Render hooks insert custom HTML without overriding Cachet views. This example registers a hook in an application service provider’sboot method:
app/Providers/AppServiceProvider.php
Htmlable object, or a view.
Cachet renders hook output as HTML. Untrusted data needs escaping before the callback returns it.
Available render hooks
Item-level hooks can run more than once on a page. Component, component-group, and schedule hooks insert content next to list items.
Visible content at these positions requires a valid
<li> element.
Render hooks for optional sections run only when Cachet renders that section. For example, metrics hooks are unavailable
when metric graphs are disabled. Registering FOOTER creates the footer boundary even when Cachet’s built-in support
and timezone content are disabled.
Compatibility
The documented attribute values and render-hook constants are public APIs. Compatibility guarantees do not cover selectors based on:- Utility classes or generated framework classes
- Element depth, child position, or heading level
- Alpine attributes such as
x-data - Filament-specific markup