block

package
v0.0.0-...-c353a36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT Imports: 4 Imported by: 0

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL