Error

LesliView::Partials::Error presents an error title, message, optional decorative illustration and additional details. It does not set an HTTP status, authorize requests or inspect error objects.

<%= render LesliView::Partials::Error.new(
    id: "not-found",
    title: t("errors.not_found.title"),
    message: t("errors.not_found.message")
) do |error| %>
    <% error.with_illustration do %>
        <%= render LesliView::Elements::Empty.new(text: nil) %>
    <% end %>
<% end %>

Pass translated text through required title: and message: keywords. Both are escaped. The optional id: supplies the prefix for the heading ID and its aria-labelledby reference; otherwise a unique prefix is generated. Use distinct IDs when rendering multiple instances on a page.

Use tone: :danger for the danger-colored heading and icon:

<%= render LesliView::Partials::Error.new(
    title: "403 Forbidden",
    message: "Contact your administrator.",
    tone: :danger
) do |error| %>
    <% error.with_illustration do %>
        <span class="material-symbols lesli-error-icon">shield_lock</span>
    <% end %>
    <% error.with_details do %>
        <ul>
            <li><%= controller_name %></li>
            <li><%= action_name %></li>
        </ul>
    <% end %>
<% end %>

The illustration region is decorative and has aria-hidden="true"; keep essential information and interactive controls outside it. The optional details slot renders inside a styled panel. Omitted slots produce no empty wrappers. The caller is responsible for escaping any dynamic values in its slot markup.

The component does not add a Turbo frame. Wrap it in Layout::Container when needed. Core preserves its existing 403/404 templates, status handling and authorization logic; Welcome is not part of this component.

Files follow the shared sidecar convention:

partials/
    error.rb
    error/
        error.html.erb
        error.css

Styles compile in LesliView and reference the shared LesliAssets theme.

 Edit this page

Last Update: 2026/11/18

Application header

LesliView::Partials::Header renders global branding, actions and optional module navigation. Use Components::Header for the heading inside an individual page.

<%= render LesliView::Partials::Header.new(
    home_url: root_path,
    home_label: "Home",
    actions_label: "Application actions",
    navigation_label: "Module navigation",
    actions: [{
        url: settings_path,
        label: "Settings",
        icon: "ri-settings-line",
        active: current_page?(settings_path),
        data: { turbo_frame: "_top" }
    }]
) do |header| %>
    <% header.with_logo do %>
        <%= image_tag "logo.svg", alt: "Application" %>
    <% end %>
    <% header.with_navigation do %>
        <li><%= link_to "Settings", settings_path %></li>
    <% end %>
<% end %>

The caller resolves routes, translates labels and selects available actions. Each action requires url, label and an icon CSS class. Optional keys are active, danger, highlighted, count and Rails link data. Positive counts show a badge capped at 99+. Active links have aria-current="page"; danger actions use destructive-action hover colors.

The logo link targets _top. Action data is passed through unchanged; the component does not invent logout methods or navigation behavior. The optional navigation slot receives list items and preserves caller markup.

Core retains logo customization, notification counts, current-route detection, optional-engine checks, logout URLs and custom navigation partial lookup. The component does not access Core helpers, accounts, sessions or engine services.

The template and CSS live in partials/header/, next to header.rb. They compile into LesliView with theme values supplied by LesliAssets.

 Edit this page

Last Update: 2026/11/18

Announcements

LesliView::Partials::Announcements displays persistent banners from plain hashes. It does not query LesliBell or determine audience membership.

<%= render LesliView::Partials::Announcements.new(
    announcements: [{
        id: 7,
        category: "info",
        category_label: "Information",
        message: "Your application is ready.",
        url: "/help",
        dismiss_url: "/bell/announcements/7/dismiss"
    }],
    label: "Announcements",
    link_label: "Learn more",
    dismiss_label: "Dismiss announcement"
) %>

Translate labels in the caller. Categories are info, success, warning and danger; unknown categories use the information presentation. Messages are escaped and preserve line breaks. Empty collections render nothing.

url and dismiss_url are optional. A dismissal URL renders a POST button; omit it for announcements that cannot be closed. The caller must authorize dismissal on the server. The banner stays visible until the response removes it.

The component preserves application-lesli-announcements, announcement-<id> and announcement-<id>-message. Core supplies authorized records, translated labels and routes; LesliBell removes the announcement ID through Turbo after successful dismissal.

The template and CSS live in partials/announcements/, next to announcements.rb. Styles compile into LesliView using the global LesliAssets theme. Announcements never disappear automatically.

Choosing a category

Category Example
info Your Lesli application is ready.
success Your data import completed successfully.
warning Scheduled maintenance starts in one hour.
danger The import failed. Review the errors before trying again.

Primary belongs to actions and selection, not message categories. Use one of the four categories above for status messages. See Button for action colors and the final solid palette.

The final theme uses sky, emerald, amber and rose inspired semantic tones. Backgrounds use shade 50, borders 300, and text 900; these opaque text pairs have contrasts of 9.76:1 (info), 9.77:1 (success), 12.65:1 (warning) and 8.92:1 (danger). LesliAssets supplies the global tokens from lesli-css; LesliView compiles the component classes. Account primary changes do not alter these status meanings or colors.

 Edit this page

Last Update: 2026/11/18

Notifications

LesliView::Partials::Notifications renders transient status messages.

<%= render LesliView::Partials::Notifications.new(
    messages: { success: "Changes saved.", warning: "Review the remaining fields." }
) %>

Pass a hash of message types and translated text. Content is escaped. notice uses success styling; alert and error use danger styling. Unknown types use neutral styling.

The application-lesli-notifications region always renders, including when messages are empty, so Turbo can replace it. The region uses aria-live="polite". Messages retain the five-second fade-out animation.

The component does not read or discard Rails flash. Core renders it with flash.to_hash, then calls flash.discard. Existing responder methods continue rendering Core's notification partial and replacing the same Turbo target.

The template, stylesheet and animation belong to partials/notifications/. They compile into LesliView; LesliAssets supplies only shared theme values.

Choosing a category

Category Example
info Your Lesli application is ready.
success Your data import completed successfully.
warning Scheduled maintenance starts in one hour.
danger The import failed. Review the errors before trying again.

Primary belongs to actions and selection, not message categories. Use one of the four categories above for status messages. See Button for action colors and the final solid palette.

The final theme uses sky, emerald, amber and rose inspired semantic tones. Backgrounds use shade 50, borders 300, and text 900; these opaque text pairs have contrasts of 9.76:1 (info), 9.77:1 (success), 12.65:1 (warning) and 8.92:1 (danger). LesliAssets supplies the global tokens from lesli-css; LesliView compiles the component classes. Account primary changes do not alter these status meanings or colors.

 Edit this page

Last Update: 2026/11/18

Engine specification

LesliView::Partials::EngineSpec renders compact metadata for an installed Lesli engine.

<%= render LesliView::Partials::EngineSpec.new(
    name: "LesliSupport",
    summary: "Customer support workflows",
    version: "1.4.0",
    build: "1791168000",
    metadata: {
        "documentation_uri" => "https://www.lesli.dev/engines/support/"
    }
) %>

The engine value must support symbol access for name, summary, version, build, and metadata, plus dig for the documentation URL. build is interpreted as a Unix timestamp and formatted with LesliDate. The documentation entry becomes an external link when metadata["documentation_uri"] is present.

This partial uses the legacy engine-status presentation and assumes LesliDate and the shared icon styles are loaded.

Component files

lib/lesli_view/partials/
    engine_spec.rb
    engine_spec/
        engine_spec.html.erb
        engine_spec.css

The Ruby class keeps the same public API. Its template and stylesheet live in the adjacent component directory. The stylesheet uses semantic classes and unprefixed Tailwind utilities inside @apply; source/tailwind/view.css imports it into the existing LesliView stylesheet. Global theme variables remain in LesliAssets.

 Edit this page

Last Update: 2026/11/18