link

package
v0.0.0-...-3341fa3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

templ: version: v0.2.680

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Badge

func Badge(badge templ.Component) templwind.OptFunc[Opts]

func Class

func Class(class string) templwind.OptFunc[Opts]

func HXDelete

func HXDelete(href string) templwind.OptFunc[Opts]

func HXGet

func HXGet(href string) templwind.OptFunc[Opts]

func HXPatch

func HXPatch(href string) templwind.OptFunc[Opts]

func HXPost

func HXPost(href string) templwind.OptFunc[Opts]

func HXPushURL

func HXPushURL(hxPushURL bool) templwind.OptFunc[Opts]

func HXPut

func HXPut(href string) templwind.OptFunc[Opts]

func HXSwap

func HXSwap(hxSwap Swap) templwind.OptFunc[Opts]

func HXTarget

func HXTarget(hxTarget string) templwind.OptFunc[Opts]

func HXTrigger

func HXTrigger(hxTrigger []string) templwind.OptFunc[Opts]

func ID

func ID(id string) templwind.OptFunc[Opts]

func Icon

func Icon(icon string) templwind.OptFunc[Opts]

func New

func New(opts ...templwind.OptFunc[Opts]) templ.Component

New creates a new component

func NewWithOpts

func NewWithOpts(opts *Opts) templ.Component

NewWithOpts creates a new component with the given opts

func Submenu(linkOpts ...*Opts) templwind.OptFunc[Opts]

func Target

func Target(target string) templwind.OptFunc[Opts]

func Title

func Title(title string) templwind.OptFunc[Opts]

func XOnTrigger

func XOnTrigger(xOnTrigger string) templwind.OptFunc[Opts]

Types

type Opts

type Opts struct {
	ID         string
	Title      string
	Badge      templ.Component
	Icon       string
	Class      string
	HXGet      string
	HXPost     string
	HXPut      string
	HXPatch    string
	HXDelete   string
	Target     string
	HXSwap     Swap
	HXTarget   string
	HXTrigger  []string
	HXPushURL  bool
	XOnTrigger string
	Submenu    []*Opts
}

func WithOpts

func WithOpts(opts ...templwind.OptFunc[Opts]) *Opts

WithOpts builds the options for the component

type Swap

type Swap string
const (
	// the default, puts the content inside the target element
	InnerHTML Swap = "innerHTML"
	// replaces the entire target element with the returned content
	OuterHTML Swap = "outerHTML"
	// prepends the content before the first child inside the target
	AfterBegin Swap = "afterbegin"
	// prepends the content before the target in the target’s parent element
	BeforeBegin Swap = "beforebegin"
	// appends the content after the last child inside the target
	BeforeEnd Swap = "beforeend"
	// appends the content after the target in the target’s parent element
	AfterEnd Swap = "afterend"
	// deletes the target element regardless of the response
	Delete Swap = "delete"
	// does not append content from response (Out of Band Swaps and Response Headers will still be processed)
	None Swap = "none"
)

func (Swap) String

func (s Swap) String() string

Jump to

Keyboard shortcuts

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