Bootstrap Template — sgcHTML | eSeGeCe

Bootstrap Template

TsgcHTMLTemplate_Bootstrap — wraps any HTML body content in a complete, self-contained Bootstrap 5 document with configurable theme, language and text direction.

TsgcHTMLTemplate_Bootstrap

The lowest-level document wrapper in sgcHTML. Assign your composed component HTML to BodyContent, configure the document-level settings, then read HTML to get a deployable, self-contained Bootstrap 5 page with embedded assets.

Component class

TsgcHTMLTemplate_Bootstrap

Role

Full Bootstrap 5 document wrapper

Languages

Delphi, C++ Builder, .NET

Assign BodyContent, read HTML

Set BodyContent to your rendered component HTML, optionally configure Title, HtmlTheme and HtmlLang, then read the HTML property to get a complete, deployable page.

uses
  sgcHTML_Template_Bootstrap;

var
  oTemplate: TsgcHTMLTemplate_Bootstrap;
begin
  oTemplate := TsgcHTMLTemplate_Bootstrap.Create(nil);
  try
    oTemplate.Title       := 'My App';
    oTemplate.HtmlTheme   := 'dark';
    oTemplate.HtmlLang    := 'en';
    oTemplate.BodyContent := oNavBar.HTML + oGrid.HTML;
    Response.ContentText  := oTemplate.HTML;
  finally
    oTemplate.Free;
  end;
end;
TsgcHTMLTemplate_Bootstrap *oTemplate = new TsgcHTMLTemplate_Bootstrap(NULL);
try
{
  oTemplate->Title       = "My App";
  oTemplate->HtmlTheme   = "dark";
  oTemplate->HtmlLang    = "en";
  oTemplate->BodyContent = oNavBar->HTML + oGrid->HTML;
  Response->ContentText  = oTemplate->HTML;
}
__finally { delete oTemplate; }
var template = new TsgcHTMLTemplate_Bootstrap();
template.Title       = "My App";
template.HtmlTheme   = "dark";
template.HtmlLang    = "en";
template.BodyContent = navbar.HTML + grid.HTML;
response.ContentText = template.HTML;

Key properties & methods

The members you reach for most often.

BodyContent

The HTML fragment placed inside the document <body>; assign the concatenated output of your sgcHTML components here.

Title

Text for the <title> element in the document head.

HtmlTheme

String written to data-bs-theme on the <html> element (for example 'light' or 'dark') so Bootstrap's colour system switches correctly. For automatic light / dark / system switching, plug a TsgcHTMLThemeBuilder (Mode = tmLight, tmDark or tmSystem) into the ThemeBuilder property.

HtmlLang

lang attribute on the <html> element; defaults to 'en'. sgcHTML also ships built-in UI text localized in 17 languages, selectable with sgcHTMLSetLanguage, so components render with correct native scripts (including CJK, Cyrillic and Arabic).

HtmlDir

String written to the dir attribute (for example 'ltr' or 'rtl') for right-to-left language support.

CustomHead

Extra HTML injected into <head>; use for custom <meta> tags or extra <script> references. Pair it with CustomCSS for inline <style> blocks.

Keep exploring

Online HelpFull API reference and usage guide for this component.
All sgcHTML ComponentsBrowse the full feature matrix of 60+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.

Ready to Get Started?

Download the free trial and start building web UIs in Delphi, C++ Builder and .NET.