{# SPDX-License-Identifier: Apache-2.0 Copyright (c) 2026 evoila Group The style guide (P2.3). Every component in every surviving variant, on one page. Two readers, two reasons: * A developer, before writing new markup — so the answer to "is there already a component for this?" is a page rather than a grep. * A reviewer, after a theme change — so a regression is one page instead of twenty. It renders in two places. Locally in meho-ui, against the brand stylesheets, via `scripts/render_styleguide.py`. And inside meho for admins, where it renders against the app's own compiled bundle — a component can look right in isolation and wrong in the app, because the app's stylesheet is in the cascade with it. The second is the one that is evidence. The top bar's sample apps, name and notification are written in this file, not passed in: they are illustration, not the app list, and a new required context variable would break every app that already renders this page under StrictUndefined. **An app that renders this page links `meho-topbar.css`** (in `meho_ui.shell.shell_css_dir()`), after `evoila-tokens.css`. The top bar section is styled by that stylesheet alone: its bars and the frames around them. Without it the section renders unstyled. Its sample theme switches also need `meho-theme.js` on the page (`meho_ui.shell.theme_script_path()`); without it they do nothing. Since P3.1 (meho-ui 0.10.0) this is a requirement of the page, not only of the bar. The variant lists come from `meho_ui.shell.VARIANTS` and `SIZES`, not from this file. A style guide that hardcodes its own list silently stops showing a variant the moment one is added, which is the single failure it cannot be allowed to have. Context: variants -- meho_ui.shell.VARIANTS sizes -- meho_ui.shell.SIZES title -- optional heading, so meho can say where it is #} {% from "_components.html" import button, badge, alert, empty_state, dialog, field, table, pager, relative_time, icon %} {% from "_top_bar.html" import top_bar %} {% macro _section(name, note) %}

{{ name }}

{{ note }}

{{ caller() }}
{% endmacro %}

{{ title | default("Component set") }}

Every component, every variant. The contract is docs/components.md. Before writing new markup, look here first.

{% call _section("top bar", "Renders what the app hands it: the switcher's entries and the person's name. With neither, it shows no switcher and a neutral Account label.") %} {% set _sg_apps = [ {"name": "MEHO", "url": "#meho", "current": true}, {"name": "Automation", "url": "#automation"}, {"name": "Knowledge", "url": "#knowledge"}, ] %} {% set _sg_bell %}{% endset %} {% set _sg_menu %}{% endset %}

Desktop width

{{ top_bar("MEHO", home_url="#", apps=_sg_apps, user_name="Ada Lovelace", sign_out_url="#sign-out", account_url="#account", notifications=_sg_bell, id_prefix="sg-topbar-desktop", start=_sg_menu, theme_switch=true) }}

Phone width (390px)

{{ top_bar("MEHO", home_url="#", apps=_sg_apps, user_name="Ada Lovelace", sign_out_url="#sign-out", account_url="#account", notifications=_sg_bell, id_prefix="sg-topbar-phone", start=_sg_menu, theme_switch=true) }}

No name, empty switcher

{{ top_bar("Knowledge", home_url="#", sign_out_url="#sign-out", id_prefix="sg-topbar-fallback") }}

The first two bars show the start slot (an app's menu button) and the theme switch in the user menu: Light, Dark or Same as my computer. With meho-theme.js on the page, the switch changes this whole page, so every component here can be checked in both themes.

The menus are popovers: Enter or Space opens one, Tab moves through it, Escape closes it and returns focus to its button. There is no script. The switcher marks the current app with aria-current. Below 40rem of its own width the MEHO wordmark gets smaller and the button labels are hidden visually; the product name stays, and ends in "…" only when a phone is too narrow for all of it.

{% endcall %} {% call _section("button", "A real