Package: bs

Declarative Bootstrap component builder for Go — breadcrumbs, cards, alerts, modals, and more.

Package: bs

Bootstrap UI components for Go. bs provides a fluent, declarative API for building Bootstrap 5 components — alerts, breadcrumbs, cards, modals, navbars, and more — as an extension of the hb HTML builder.

Repository: https://github.com/dracory/bs

Installation

go get github.com/dracory/bs

Usage

package main

import (
    "github.com/dracory/bs"
)

func main() {
    breadcrumb := bs.Breadcrumb().
        Child(bs.BreadcrumbItem().Href("/").Text("Home")).
        Child(bs.BreadcrumbItem().Href("/docs").Text("Docs").Active(true))

    html := breadcrumb.ToHTML()
}

Features

  • Comprehensive Bootstrap 5 coverage: alerts, badges, breadcrumbs, buttons, cards, modals, navbars, pagination, toasts.
  • Fluent builders returning hb.TagInterface — composes freely with raw hb markup.
  • No JavaScript bundling concerns — emits standard Bootstrap markup.