badge

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

templ: version: v0.3.977

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Badge

func Badge(props ...Props) templ.Component

Types

type Props

type Props struct {
	ID         string
	Class      string
	Attributes templ.Attributes
	Variant    Variant
	Style      Style
	Size       Size
}

Props configures a badge.

type Size

type Size string

Size controls the badge size.

const (
	SizeDefault Size = ""
	SizeXs      Size = "badge-xs"
	SizeSm      Size = "badge-sm"
	SizeMd      Size = "badge-md"
	SizeLg      Size = "badge-lg"
	SizeXl      Size = "badge-xl"
)

type Style

type Style string

Style controls the badge visual style.

const (
	StyleDefault Style = ""
	StyleOutline Style = "badge-outline"
	StyleDash    Style = "badge-dash"
	StyleSoft    Style = "badge-soft"
	StyleGhost   Style = "badge-ghost"
)

type Variant

type Variant string

Variant controls the badge color.

const (
	VariantDefault   Variant = ""
	VariantNeutral   Variant = "badge-neutral"
	VariantPrimary   Variant = "badge-primary"
	VariantSecondary Variant = "badge-secondary"
	VariantAccent    Variant = "badge-accent"
	VariantInfo      Variant = "badge-info"
	VariantSuccess   Variant = "badge-success"
	VariantWarning   Variant = "badge-warning"
	VariantError     Variant = "badge-error"
)

Jump to

Keyboard shortcuts

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