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, Theme and Language, 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.Theme       := htDark;
    oTemplate.Language    := '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->Theme       = htDark;
  oTemplate->Language    = "en";
  oTemplate->BodyContent = oNavBar->HTML + oGrid->HTML;
  Response->ContentText  = oTemplate->HTML;
}
__finally { delete oTemplate; }
var template = new TsgcHTMLTemplate_Bootstrap();
template.Title       = "My App";
template.Theme       = TsgcHTMLTheme.htDark;
template.Language    = "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.

Theme

htLight, htDark or htSystem; sets data-bs-theme on the <html> element so Bootstrap's colour system switches correctly.

Language

lang attribute on the <html> element; defaults to 'en'.

Direction

hdLTR or hdRTL; sets the dir attribute for right-to-left language support.

HeadContent

Extra HTML injected into <head> before the closing tag; use for custom <style> blocks, <meta> tags or extra <script> references.

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.