templwind

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 5 Imported by: 0

README

soul

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentToString

func ComponentToString(c templ.Component) (string, error)

func New

func New[T any](defaultProps func() *T, tpl func(*T) templ.Component, props ...OptFunc[T]) templ.Component

New creates a new templ.Component with the given props

func NewWithProps

func NewWithProps[T any](tpl func(*T) templ.Component, props *T) templ.Component

NewWithProps creates a new templ.Component with the given prop

func Render

func Render(ctx echo.Context, status int, t templ.Component) error

func WithProps

func WithProps[T any](defaultProps func() *T, props ...OptFunc[T]) *T

WithProps constructs the props with the given prop functions

Types

type Component

type Component[T any] interface {
	New(props ...OptFunc[T]) templ.Component
	NewWithOpt(prop *T) templ.Component
	WithProps(props ...OptFunc[T]) *T
}

Component interface with generic methods

type OptFunc

type OptFunc[T any] func(*T)

OptFunc is a generic function type for props

Directories

Path Synopsis
db
tools
soul Module

Jump to

Keyboard shortcuts

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