div

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

templ: version: v0.2.793

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func C

func C(def D) templ.Component
Example
package main

import (
	"context"
	"os"

	"github.com/a-h/templ"
	"github.com/jfbus/templui/components/div"
	"github.com/jfbus/templui/components/style"
)

func myComponent() templ.Component {
	return templ.Raw(`Content`)
}

func main() {
	c := div.C(div.D{
		Content: myComponent(),
		CustomStyle: style.Custom{
			"div": style.D{
				style.Set("text-sm"),
			},
		},
	})
	_ = c.Render(context.TODO(), os.Stdout)
}
Output:

<div class="text-sm">Content</div>

Types

type D

type D struct {
	//playground:import:github.com/jfbus/templui/components/button
	//playground:default:button.C(button.D{Label:"Button"})
	Content     templ.Component
	CustomStyle style.Custom
}

Jump to

Keyboard shortcuts

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