The marketing-site top bar: the logo on the left, the links in the center (one may open a mega menu), Entrar and the primary button on the right.
<.landing_nav id="site-nav" brand={%{name: "Ledger", logo: "L", navigate: ~p"/"}}>
<:link label="Produto">
<.landing_mega>
<.landing_feature icon="kanban" title="Projetos" description="Kanban, prazos" navigate={~p"/projetos"} />
</.landing_mega>
</:link>
<:link label="Preços" navigate={~p"/precos"} active />
<:actions>
<.landing_login navigate={~p"/entrar"}>Entrar</.landing_login>
<.landing_cta navigate={~p"/cadastro"}>Começar grátis</.landing_cta>
</:actions>
</.landing_nav>Variants
default- the classic bar, in the page flow.float- a detached pill of frosted glass.clear- transparent over a hero image; withstickyit turns solid once the page scrolls.tintanddark- the accent wash and the near-black bar.mobile- the phone layout at any width: logo and the menu button.
sticky pins the bar to the top (position: sticky) and mounts the LedgerUI.LandingNav hook,
which sets data-stuck after stuck_after px of scroll. A :link with inner content is a
trigger: a button with aria-expanded / aria-controls that opens the content as the mega menu
(landing_mega/1), with hover (open_on="hover") or click; Escape and a click outside close it,
arrows walk the items. The hook is mounted when there is a trigger, sticky or responsive.
responsive hides the links and the primary button below 768px and shows the menu button
(a panel listing every link and the :actions again, so do not put an id inside :actions).
The mobile variant always has the menu button. Without a :logo slot the brand map is used
(%{name, navigate, logo | src | icon}: icon draws the bare icon beside the name, as in the canvas).
A :link with caret is a plain link with the "▾" after its label, for a mega menu that is drawn
apart (landing_mega/1 beside the bar, as in the canvas).
Summary
Functions
The thin announcement strip above the bar; the close button hides it with JS.hide.
The primary button of the bar. A link when it has href, navigate or patch, else a button.
One feature of the mega menu: an icon in a box, the title and a line of description.
The "Entrar" link of the bar.
The mega menu content (inside a :link of landing_nav/1): the features and, optionally, a side panel.
The highlighted panel beside the features: an eyebrow, the title, the text, a thumbnail and a link.
A product card of landing_mega variant="cards": logo and name, a large title, a link and a preview.
Functions
The thin announcement strip above the bar; the close button hides it with JS.hide.
Attributes
id(:string) (required)eyebrow(:string) - Defaults tonil.link_label(:string) - Defaults tonil.href(:string) - Defaults to"#".navigate(:string) - Defaults tonil.dismissible(:boolean) - Defaults totrue.close_label(:string) - Defaults to"Close".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
The primary button of the bar. A link when it has href, navigate or patch, else a button.
Attributes
size(:string) - Defaults to"md". Must be one of"md", or"lg".block(:boolean) - Defaults tofalse.icon(:string) - Defaults tonil.href(:string) - Defaults tonil.navigate(:string) - Defaults tonil.patch(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled", "form", "name", "value", "phx-click"].
Slots
inner_block(required)
One feature of the mega menu: an icon in a box, the title and a line of description.
Attributes
icon(:string) - Defaults tonil.title(:string) (required)description(:string) - Defaults tonil.href(:string) - Defaults to"#".navigate(:string) - Defaults tonil.patch(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
The "Entrar" link of the bar.
Attributes
href(:string) - Defaults to"#".navigate(:string) - Defaults tonil.patch(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
The mega menu content (inside a :link of landing_nav/1): the features and, optionally, a side panel.
Attributes
variant(:string) - Defaults to"default". Must be one of"default", or"cards".columns(:integer) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)side
The highlighted panel beside the features: an eyebrow, the title, the text, a thumbnail and a link.
Attributes
eyebrow(:string) - Defaults tonil.title(:string) (required)thumb(:boolean) - Defaults tofalse.link_label(:string) - Defaults tonil.href(:string) - Defaults to"#".navigate(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block
A product card of landing_mega variant="cards": logo and name, a large title, a link and a preview.
Attributes
title(:string) (required)name(:string) - Defaults tonil.logo(:string) - Defaults tonil.link_label(:string) - Defaults tonil.tone(:string) - Defaults to"default". Must be one of"default","tint", or"dark".accent(:string) - Defaults tonil.mock(:boolean) - Defaults tofalse.compact(:boolean) - A static mini card (div): only the title, as in the canvas menu. Defaults tofalse.href(:string) - Defaults to"#".navigate(:string) - Defaults tonil.patch(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
markpreview