component

package
v0.0.0-...-15283aa Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SizeSm = size{"sm"}
	SizeMd = size{"md"}
	SizeLg = size{"lg"}
)

Functions

func H1

func H1(children ...gomponents.Node) gomponents.Node

func H1Text

func H1Text(text string) gomponents.Node

H1Text is a convenience function to create an H1 element with a simple text node as its child.

func H2

func H2(children ...gomponents.Node) gomponents.Node

func H2Text

func H2Text(text string) gomponents.Node

H2Text is a convenience function to create an H2 element with a simple text node as its child.

func H3

func H3(children ...gomponents.Node) gomponents.Node

func H3Text

func H3Text(text string) gomponents.Node

H3Text is a convenience function to create an H3 element with a simple text node as its child.

func H4

func H4(children ...gomponents.Node) gomponents.Node

func H4Text

func H4Text(text string) gomponents.Node

H4Text is a convenience function to create an H4 element with a simple text node as its child.

func H5

func H5(children ...gomponents.Node) gomponents.Node

func H5Text

func H5Text(text string) gomponents.Node

H5Text is a convenience function to create an H5 element with a simple text node as its child.

func H6

func H6(children ...gomponents.Node) gomponents.Node

func H6Text

func H6Text(text string) gomponents.Node

H6Text is a convenience function to create an H6 element with a simple text node as its child.

func HxLoadingLg

func HxLoadingLg(centered bool, id ...string) gomponents.Node

HxLoadingLg returns a large loading indicator.

func HxLoadingMd

func HxLoadingMd(centered bool, id ...string) gomponents.Node

HxLoadingMd returns a loading indicator.

func HxLoadingSm

func HxLoadingSm(centered bool, id ...string) gomponents.Node

HxLoadingSm returns a small loading indicator.

func PText

func PText(text string) gomponents.Node

PText is a convenience function to create a P element with a simple text node as its child.

func RenderableGroup

func RenderableGroup(children []gomponents.Node) gomponents.Node

RenderableGroup renders a group of nodes without a parent element.

This is because gomponents.Group() cannot be directly rendered and needs to be wrapped in a parent element.

func SpanText

func SpanText(text string) gomponents.Node

SpanText is a convenience function to create a Span element with a simple text node as its child.

func SpinnerContainerLg

func SpinnerContainerLg(height ...string) gomponents.Node

func SpinnerContainerMd

func SpinnerContainerMd(height ...string) gomponents.Node

func SpinnerContainerSm

func SpinnerContainerSm(height ...string) gomponents.Node

func SpinnerLg

func SpinnerLg() gomponents.Node

func SpinnerMd

func SpinnerMd() gomponents.Node

func SpinnerSm

func SpinnerSm() gomponents.Node

Types

type ModalParams

type ModalParams struct {
	// ID is the ID of the modal dialog. If empty, a random ID will be generated.
	ID string
	// Content is the content of the modal dialog.
	Content []gomponents.Node
	// Size is the size of the modal dialog.
	// Can be "sm", "md", and "lg".
	// The default is "md".
	Size size
	// Title is the title of the modal dialog.
	// If you need more than a string, use TitleNode instead.
	Title string
	// TitleNode is the title of the modal dialog.
	// If you need only a string, use Title instead.
	TitleNode gomponents.Node
	// HTMXIndicator is an optional ID of an HTMX indicator that
	// should be inserted in the modal header.
	HTMXIndicator string
}

ModalParams are the props for the Modal component.

type ModalResult

type ModalResult struct {
	// HTML is the modal dialog HTML.
	HTML gomponents.Node
	// OpenerAttr is the attribute to add to the element that opens the modal dialog.
	OpenerAttr gomponents.Node
}

ModalResult is the result of creating a modal dialog.

func Modal(params ModalParams) ModalResult

Modal renders a modal dialog.

Jump to

Keyboard shortcuts

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