Layout

Layout

Layout is the Rust-only application skeleton: a fixed background, a full-width header, a body row that holds an aside and a scrolling main region, and a full-width footer. The four pieces it places — Header, Aside, Content, Footer — have no pages of their own; this page documents them together with the frame that arranges them.

This page documents a legacy migration surface. Layout settled in the Rust crate before the component pages existed, and packages/vue/src ships no HkLayout, so there is no Vue twin and no shared stylesheet mirror. Treat its shape as frozen, not as the house pattern. For new work, a host's own page skeleton (a CSS grid or flex shell around the page's real regions) replaces Layout: the component hard-codes a 100vh box, a calc(100vh - 60px) body despite a 64px header, and a Background layer into every tree, which fights a page that already owns its layout — and Header / Aside / Footer are still usable on their own inside such a shell.

  • A floating bar over a page or a canvas is DockBar; a page skeleton is the host's own markup.
  • After the frame, the content is ordinary sections: Section for a titled block, Space for the gaps, Divider for rules.
  • A responsive column system is Grid.

Import

rust
1
2
use hikari_components::*;          // Layout, Header, Aside, Content, Footer
use hikari_components::prelude::*; // rsx!, VNode

Each is a plain function taking its props directly: Layout(LayoutProps { … }), Header(HeaderProps { … }). Layout / Header / Content / Aside are declared with inline parameter lists, so their *Props structs are not re-exported by the prelude — import them explicitly if a host needs to name the type. Footer is the one that declares a FooterProps, and it is in the prelude; Grid / Row / Col follow the same split (see Grid). Inside rsx! every prop may be omitted except the required children slot, which has no default on any of the five (omitting it panics with ` children is required but was not provided ). In these examples children is written as children: Some(rsx! { … }) on Layout, Header and Aside — the shape the macro accepts here — and as the bare children: rsx! { … } the Footer and Content blocks take; header, aside and right_content are Option slots written as Some(rsx! { … })`.

The frame (Layout, Header, Aside, Footer)

Layout has three slot props and one default slot: header renders full width at the top, aside becomes the sidebar and turns on the hk-layout-has-sidebar class (a 260px fixed column beside the main region), footer renders full width at the bottom, and the children fill <main class="hk-layout-content">, the one scrolling region of the frame. glassmorphism and background_color are declared but the sheet ignores both: the root is transparent and hk-layout-light overrides its own background, so the only thing painted behind the frame is the Background element the component always emits first.

The frame is height: 100vh with overflow: hidden, so it claims the whole viewport wherever it is mounted; inside a document example it therefore fills the stage rather than being boxed by it.

Rust

Console

Main region.

Built 2026

Header and Aside

Header is the sticky top bar: 64px tall, position: sticky at top: 0, z-index: 100, a bottom border until bordered: false switches it to the transparent variant. Its children are the leading cluster; right_content is a trailing element pinned to the opposite edge. show_menu_toggle adds the hamburger, which is display: none above 768px and only becomes reachable on narrow viewports, and on_menu_toggle is the host's handler for it.

Aside is the sidebar column: width is one of sm / md / lg (200 / 260 / 320px by the sheet's own values — Layout hard-codes 260px for the column it arranges), variant is light or anything else for dark, and header / footer are optional element slots framing the scrolling content region. rtl overrides the theme's layout direction for this instance. Two props are declared but inert: collapsible and initial_open seed a local use_signal that no rule in the sheet reads, so the drawer never actually closes around the panel — a host that needs the collapse keeps it on its own side.

Rust

Console

ada

Content and Footer

Content is the main-area wrapper: background_color defaults to var(--hi-background, #f5f5f5), padding defaults to the string "p-6 lg:p-10" — which the component writes into style="padding: …" verbatim, so the default only works as a padding declaration for a CSS value, and a host that wants the intended inset passes a real length. scrollable (the default) adds overflow-y-auto.

Footer is a centered 24px-padded strip with a top border; its children are the only content. Both Header and Aside sit inside the frame's body row, while Content is the wrapper you would reach for when a main region is not the frame's own <main>.

Rust

Main region.

Built 2026

API

Rust

Props — Layout

PropTypeDefaultDescription
headerOption<Element>None—
asideOption<Element>None—
footerOption<Element>None—
childrenElement——
glassmorphismbooltrue—
background_colorString"var(--hi-background, #f8fafc)".to_string()—
classString""—

Props — Aside

PropTypeDefaultDescription
childrenElement——
headerOption<Element>None—
footerOption<Element>None—
widthString"md".to_string()—
variantString"white".to_string()—
collapsiblebooltrue—
initial_openboolfalse—
rtlOption<bool>None—
on_closeOption<EventHandler<MouseEvent>>None—
classString""—

Props — Content

PropTypeDefaultDescription
childrenElement——
background_colorString"var(--hi-background, #f5f5f5)".to_string()—
paddingString"p-6 lg:p-10".to_string()—
scrollablebooltrue—
classString""—

Props — Header

PropTypeDefaultDescription
childrenElement——
borderedbooltrue—
show_menu_toggleboolfalse—
on_menu_toggleOption<EventHandler<MouseEvent>>None—
rtlOption<bool>None—
classString""—
right_contentOption<Element>None—

Props — Footer

PropTypeDefaultDescription
childrenElement(empty)—
classString""—

Accessibility

  • The frame renders real header, main and footer elements, so assistive technology gets banner and contentinfo landmarks from the tag names — but only when the frame is the page's top-level layout; nesting it inside another article/section turns those into scoped landmarks.
  • Aside renders a bare <aside>, which is a complementary landmark only when it is named; give its header slot a real heading (h2) so the column can be skipped by a landmark or heading jump.
  • The scrolling region is <main class="hk-layout-content">; a keyboard user only reaches it as a focusable scroll box when it is focused, so keep the focused content inside it rather than relying on the region itself as a stop.
  • The menu toggle Header can render has a hard-coded aria-label="Toggle menu" and is hidden by CSS above 768px; pointing on_menu_toggle at a drawer keeps the button honest only while that drawer exists.
  • Layout paints a Background element into every tree and gives it no text; it is decorative and carries no name.

Related components

  • DockBar — the floating bar for docks that live over a page or canvas rather than in a frame.
  • Grid — the column system a host can use to build its own skeleton.
  • Section — a titled content block, with Spacer for gaps.
  • Container — the responsive max-width wrapper for page content.
  • Divider — the rule between regions of a hand-built skeleton.