sgcHTML Layout and Navigation
Fifteen widgets that give a page its structure and its navigation: the bars and
rails around the content, the containers that group it, and the controls that
move between views.
Read sgcwebsockets-html-core first for the page builder and the edition gate.
sgcHTML is All-Access only, needs Indy, and is absent on Android and iOS.
When to use this skill
- Put a navbar across the top, or a sidebar down the side
- Split content into tabs, an accordion or a stepper
- Show where the user is with a breadcrumb, or move between pages with a pager
- Group content into a panel or a list group
- Slide something in from the edge with an offcanvas
- Add a toolbar, a button group, a dropdown or a right-click context menu
- Divide a region with a draggable splitter
Components in this skill
| Group |
Components |
| Page chrome |
_NavBar, _Sidebar, _Toolbar |
| Sectioning |
_Tabs, _Accordion, _Stepper, _Panel, _Splitter |
| Navigation |
_Breadcrumb, _Pagination, _ListGroup |
| Actions |
_ButtonGroup, _Dropdown, _ContextMenu |
| Overlay |
_Offcanvas |
All are prefixed TsgcHTMLComponent_.
The shape these share
Layout widgets are configured by property and by an items collection rather than
built with methods. A navbar is representative:
FNav := TsgcHTMLComponent_NavBar.Create(Self);
FNav.PageBuilder := FPage;
FNav.Brand := 'My App';
FNav.BrandHref := '/';
FNav.Fluid := True;
// FNav.Items is a collection; add entries to it for the links
Items is a collection you populate, and its item type is documented under
reference/types/. Theme and Expand control the colour scheme and the width
at which the bar collapses to a hamburger.
They also carry the same shared surface as every other sgcHTML widget:
PageBuilder, Section, ColumnWidth, ElementID, CSSClass, Style,
ComponentVisible and a read-only HTML. sgcwebsockets-html-forms documents
that surface in full, including the two traps: the label property is Label_
with a trailing underscore, and OnClick is a string of JavaScript rather than
a Delphi event.
Before you start, ask the developer
Use a structured question tool if your host has one, for example Claude Code's
AskUserQuestion. Otherwise ask in chat:
- Is there a shell already?
TsgcHTMLDashboardLayout and
TsgcHTMLComponent_Site in sgcwebsockets-html-core provide a whole page
shell. Adding a navbar and sidebar by hand on top of one duplicates it.
- How should it behave on a phone?
Expand decides when a navbar
collapses, and an offcanvas is usually the right sidebar on a small screen.
- Tabs or accordion or stepper? All three divide content. Tabs are
parallel, an accordion is collapsible detail, a stepper implies order and
progress. Picking by look rather than by meaning ages badly.
- Do navigation items reload the page or swap a fragment? With HTMX they
swap. Without it, each item is a normal link and a full request.
Things that catch people out
- Layout widgets still need
PageBuilder assigned. Nothing renders without it.
- A navbar and a sidebar are separate components. The page builder has
GetNavBarHTML and GetSidebarHTML for rendering those regions on their own,
which is what you use when HTMX is swapping one part of the page.
Expand is a breakpoint, not a boolean. Setting it wrong gives a navbar that
collapses on a desktop or never collapses on a phone.
- Tabs, accordions and offcanvas panels need stable ids. If you generate ids
dynamically and they change between renders, the browser loses which panel was
open.
- A context menu is a browser-level right-click replacement. It will not appear
in a browser configured to block that, so do not put anything essential behind
it alone.
- Pagination renders the control, it does not page the data. The paging itself
is on the data widget or your query, and
_DataTable in
sgcwebsockets-html-data already has its own.
Routing
- Find a component:
reference/components-index.md lists every component, its unit, and its edition, grouped by Reg module.
- Uses clause: add the component's
unit: value (shown on its API page) to your uses clause. Nothing compiles without it.
- API detail:
reference/api/<Component>.md has the Properties, Events and Methods, each in both Delphi and C++Builder form.
- Option / enum / event types: property and event types link to
reference/types/<TypeName>.md, which documents the sub-properties of option classes, the values of enums, and the parameter list of event handlers.
- Examples:
examples/index.md is the full demo catalog; examples/<Component>.md is a focused, real usage snippet for the most-used components.
- Concepts:
concepts/overview.md (getting started + uses-clause rule) and concepts/editions-and-features.md (which components your edition includes).
- Bundled resources:
concepts/resources.md lists the browser-side assets (JavaScript, HTML, CSS) the server components serve or embed, so a browser client works without an external CDN.
- Version history:
reference/history.md lists what changed in each sgcWebSockets release.
Editions
Components are gated by edition (Professional, Enterprise, All-Access) or by a feature define. Check the edition column in the components index, or concepts/editions-and-features.md, before relying on a component.
Only public and published members are documented. Method bodies, private fields and protected members are intentionally not included.
1---2name: sgcwebsockets-html-layout3description: sgcHTML Layout and Navigation4---56# sgcHTML Layout and Navigation78Fifteen widgets that give a page its structure and its navigation: the bars and9rails around the content, the containers that group it, and the controls that10move between views.1112Read `sgcwebsockets-html-core` first for the page builder and the edition gate.13sgcHTML is All-Access only, needs Indy, and is absent on Android and iOS.1415## When to use this skill1617- Put a navbar across the top, or a sidebar down the side18- Split content into tabs, an accordion or a stepper19- Show where the user is with a breadcrumb, or move between pages with a pager20- Group content into a panel or a list group21- Slide something in from the edge with an offcanvas22- Add a toolbar, a button group, a dropdown or a right-click context menu23- Divide a region with a draggable splitter2425## Components in this skill2627| Group | Components |28| --- | --- |29| Page chrome | `_NavBar`, `_Sidebar`, `_Toolbar` |30| Sectioning | `_Tabs`, `_Accordion`, `_Stepper`, `_Panel`, `_Splitter` |31| Navigation | `_Breadcrumb`, `_Pagination`, `_ListGroup` |32| Actions | `_ButtonGroup`, `_Dropdown`, `_ContextMenu` |33| Overlay | `_Offcanvas` |3435All are prefixed `TsgcHTMLComponent_`.3637## The shape these share3839Layout widgets are configured by property and by an items collection rather than40built with methods. A navbar is representative:4142```pascal43FNav := TsgcHTMLComponent_NavBar.Create(Self);44FNav.PageBuilder := FPage;45FNav.Brand := 'My App';46FNav.BrandHref := '/';47FNav.Fluid := True;48// FNav.Items is a collection; add entries to it for the links49```5051`Items` is a collection you populate, and its item type is documented under52`reference/types/`. `Theme` and `Expand` control the colour scheme and the width53at which the bar collapses to a hamburger.5455They also carry the same shared surface as every other sgcHTML widget:56`PageBuilder`, `Section`, `ColumnWidth`, `ElementID`, `CSSClass`, `Style`,57`ComponentVisible` and a read-only `HTML`. `sgcwebsockets-html-forms` documents58that surface in full, including the two traps: the label property is `Label_`59with a trailing underscore, and `OnClick` is a string of JavaScript rather than60a Delphi event.6162## Before you start, ask the developer6364Use a structured question tool if your host has one, for example Claude Code's65`AskUserQuestion`. Otherwise ask in chat:66671. **Is there a shell already?** `TsgcHTMLDashboardLayout` and68 `TsgcHTMLComponent_Site` in `sgcwebsockets-html-core` provide a whole page69 shell. Adding a navbar and sidebar by hand on top of one duplicates it.702. **How should it behave on a phone?** `Expand` decides when a navbar71 collapses, and an offcanvas is usually the right sidebar on a small screen.723. **Tabs or accordion or stepper?** All three divide content. Tabs are73 parallel, an accordion is collapsible detail, a stepper implies order and74 progress. Picking by look rather than by meaning ages badly.754. **Do navigation items reload the page or swap a fragment?** With HTMX they76 swap. Without it, each item is a normal link and a full request.7778## Things that catch people out7980- Layout widgets still need `PageBuilder` assigned. Nothing renders without it.81- A navbar and a sidebar are separate components. The page builder has82 `GetNavBarHTML` and `GetSidebarHTML` for rendering those regions on their own,83 which is what you use when HTMX is swapping one part of the page.84- `Expand` is a breakpoint, not a boolean. Setting it wrong gives a navbar that85 collapses on a desktop or never collapses on a phone.86- Tabs, accordions and offcanvas panels need stable ids. If you generate ids87 dynamically and they change between renders, the browser loses which panel was88 open.89- A context menu is a browser-level right-click replacement. It will not appear90 in a browser configured to block that, so do not put anything essential behind91 it alone.92- Pagination renders the control, it does not page the data. The paging itself93 is on the data widget or your query, and `_DataTable` in94 `sgcwebsockets-html-data` already has its own.9596## Routing9798- **Find a component**: `reference/components-index.md` lists every component, its `unit`, and its edition, grouped by Reg module.99- **Uses clause**: add the component's `unit:` value (shown on its API page) to your `uses` clause. Nothing compiles without it.100- **API detail**: `reference/api/<Component>.md` has the Properties, Events and Methods, each in both Delphi and C++Builder form.101- **Option / enum / event types**: property and event types link to `reference/types/<TypeName>.md`, which documents the sub-properties of option classes, the values of enums, and the parameter list of event handlers.102- **Examples**: `examples/index.md` is the full demo catalog; `examples/<Component>.md` is a focused, real usage snippet for the most-used components.103- **Concepts**: `concepts/overview.md` (getting started + uses-clause rule) and `concepts/editions-and-features.md` (which components your edition includes).104- **Bundled resources**: `concepts/resources.md` lists the browser-side assets (JavaScript, HTML, CSS) the server components serve or embed, so a browser client works without an external CDN.105- **Version history**: `reference/history.md` lists what changed in each sgcWebSockets release.106107## Editions108109Components are gated by edition (Professional, Enterprise, All-Access) or by a feature define. Check the edition column in the components index, or `concepts/editions-and-features.md`, before relying on a component.110111Only public and published members are documented. Method bodies, private fields and protected members are intentionally not included.112