avatar

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 Avatar

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

func Group

func Group(props ...GroupProps) templ.Component

Types

type GroupProps

type GroupProps struct {
	ID         string
	Class      string
	Attributes templ.Attributes
}

GroupProps configures an avatar group.

type Props

type Props struct {
	ID          string
	Class       string
	Attributes  templ.Attributes
	Status      Status
	Size        Size
	Shape       Shape
	Placeholder bool
	Src         string
	Alt         string
}

Props configures an avatar.

type Shape

type Shape string

Shape controls the avatar border shape.

const (
	ShapeDefault   Shape = ""
	ShapeRounded   Shape = "rounded"
	ShapeRoundedXl Shape = "rounded-xl"
	ShapeCircle    Shape = "rounded-full"
	ShapeSquircle  Shape = "mask mask-squircle"
	ShapeHeart     Shape = "mask mask-heart"
	ShapeHexagon   Shape = "mask mask-hexagon-2"
)

type Size

type Size string

Size controls the avatar width.

const (
	SizeDefault Size = ""
	SizeXs      Size = "w-8"
	SizeSm      Size = "w-12"
	SizeMd      Size = "w-16"
	SizeLg      Size = "w-20"
	SizeXl      Size = "w-24"
	Size2xl     Size = "w-32"
)

type Status

type Status string

Status shows an online/offline indicator.

const (
	StatusDefault Status = ""
	StatusOnline  Status = "avatar-online"
	StatusOffline Status = "avatar-offline"
)

Jump to

Keyboard shortcuts

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