classes

package
v0.0.0-...-a1418dc Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package classes can be inherited by components to provide the ability to set custom classes on the component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class = string

Class represents a CSS class.

type Classes

type Classes struct {
	// contains filtered or unexported fields
}

Classes holds custom classes for a component.

func New

func New() *Classes

New initializes a Classes object for use in a Component.

func (*Classes) AddClasses

func (c *Classes) AddClasses(class ...Class)

AddClasses will add the given class to the list of classes.

func (*Classes) HasClasses

func (c *Classes) HasClasses() bool

HasClasses returns a boolean indicating whether any classes have been set.

func (*Classes) ShowClasses

func (c *Classes) ShowClasses() templ.KeyValue[string, bool]

ShowClasses returns a space-separated string with all classes.

Jump to

Keyboard shortcuts

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