rating

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 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 HalfStar

func HalfStar(props HalfStarProps) templ.Component

HalfStar renders two <input type="radio"> for the left and right halves of a star.

func Rating

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

Rating renders a <div class="rating"> container for radio star inputs.

func Star

func Star(props StarProps) templ.Component

Star renders an <input type="radio"> styled as a rating star.

Types

type HalfStarProps

type HalfStarProps struct {
	Class   string
	Name    string
	Mask    Mask
	Label1  string
	Label2  string
	Checked int // 1 for first half, 2 for second half, 0 for neither
}

HalfStar renders a pair of inputs for half-star rating (left half + right half).

type Mask

type Mask string
const (
	MaskStar  Mask = "mask-star"
	MaskStar2 Mask = "mask-star-2"
	MaskHeart Mask = "mask-heart"
)

type Props

type Props struct {
	ID         string
	Class      string
	Attributes templ.Attributes
	Size       Size
	Half       bool
}

type Size

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

type StarProps

type StarProps struct {
	Class      string
	Attributes templ.Attributes
	Name       string
	Mask       Mask
	Label      string
	Checked    bool
	Disabled   bool
	Hidden     bool
}

Jump to

Keyboard shortcuts

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