link

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LinkVariants = uiutils.Variants{
	Base: "inline-flex items-center gap-1 underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
	Keys: []string{"variant", "size"},
	Defaults: map[string]string{
		"variant": "default",
		"size":    "default",
	},
	ByKey: map[string]map[string]string{
		"variant": {
			"default":  "text-primary hover:underline",
			"muted":    "text-muted-foreground hover:text-foreground hover:underline",
			"nav":      "text-foreground hover:text-primary",
			"block":    "flex w-full text-foreground hover:text-primary",
			"external": "text-primary hover:underline",
			"unstyled": "",
		},
		"size": {
			"sm":      "text-sm",
			"default": "text-sm",
			"md":      "text-base",
			"lg":      "text-lg",
		},
	},
}

Functions

func Link(p LinkProps) templ.Component

Link renders a semantic anchor element.

func LinkClasses

func LinkClasses(p LinkProps) string

Types

type LinkProps

type LinkProps struct {
	Variant     string
	Size        string
	Class       string
	Href        string
	Target      string
	Rel         string
	Download    string
	External    bool
	Disabled    bool
	AriaCurrent string
	AriaLabel   string
	ID          string
	Role        string
	TabIndex    string
	Attrs       templ.Attributes
}

LinkProps configures a native anchor.

Jump to

Keyboard shortcuts

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