a

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/jfbus/templui/components/a"
	"github.com/jfbus/templui/components/style"
)

func main() {
	c := a.C(a.D{
		Href: "https://www.example.com",
		Text: "Example",
		CustomStyle: style.Custom{
			"a": style.D{style.Add("text-sm")},
		},
	})
	_ = c.Render(context.TODO(), os.Stdout)
}
Output:

<a href="https://www.example.com" class="hover:underline text-sm">Example</a>

Types

type D

type D struct {
	// Href is the target URL.
	Href string
	// Text is the link text.
	Text string
	// CustomStyle defines a custom style.
	// 	style.Custom{
	// 		"a": style.D{style.Add("text-sm")},
	//	}
	CustomStyle style.Custom
	// Attributes defines additional HTML attributes.
	Attributes templ.Attributes
}

Jump to

Keyboard shortcuts

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