Documentation
¶
Index ¶
Constants ¶
const ( PartBrand = widget.Part("brand") PartLogo = widget.Part("logo") PartToggle = widget.Part("toggle") PartMenu = widget.Part("menu") PartLink = widget.Part("link") PartActions = widget.Part("actions") PartIconOpen = widget.Part("icon-open") PartIconClose = widget.Part("icon-close") )
NameSiteNav is the widget name for sitenav.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NavItem ¶
type NavItem struct {
}
NavItem represents a single link item in the site navigation bar.
type SiteNav ¶
type SiteNav struct {
}
SiteNav provides the main site header with brand logo, navigation links, actions, and a responsive mobile toggle menu.
func (*SiteNav) IconSvg ¶
IconSvg registers the hamburger menu and close icon glyphs for mobile navigation.
func (*SiteNav) RenderCSS ¶
func (sn *SiteNav) RenderCSS() *css.Stylesheet
RenderCSS defines the visual stylesheet for sitenav.
func (*SiteNav) RenderJS ¶
RenderJS returns the vanilla JavaScript snippet responsible for the mobile menu toggle behavior and link click auto-close.
The open state is written as data-open on the MENU, which is the attribute widget.Open resolves to and the one RenderCSS selects on. It used to toggle an "is-open" class instead — a name no stylesheet in the ecosystem has ever matched, so the button flipped a class nothing read and the menu never opened. aria-expanded stays on the button: that is the assistive-technology contract, and it lives on the control, not on what it controls.
func (*SiteNav) WidgetKind ¶
WidgetKind is Disclosure, not Region: the markup this component already emits IS the disclosure pattern — a button carrying aria-expanded and aria-controls that shows and hides the region it names. Region has no expandable state at all (widget.Kind.Allows), so declaring it left the collapsed mobile menu inexpressible: the toggle rendered and did nothing a stylesheet could react to.