Documentation
¶
Overview ¶
templ: version: v0.3.1001
Package block exposes a top-level semantic layout primitive ID + tag + Class only.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Block ¶
func Block(props BlockProps) templ.Component
Example ¶
package main
import (
"bytes"
"context"
"fmt"
"github.com/fastygo/base/block"
)
func main() {
var buf bytes.Buffer
cmp := block.Block(block.BlockProps{Tag: "section", ID: "hero", Class: "hero-root"})
if err := cmp.Render(context.Background(), &buf); err != nil {
panic(err)
}
fmt.Print(buf.String())
}
Output: <section class="hero-root" id="hero"></section>
Types ¶
type BlockProps ¶
type BlockProps struct {
ID string
Class string
Tag string
Attrs templ.Attributes
}
Click to show internal directories.
Click to hide internal directories.