dropdown

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: 4 Imported by: 0

Documentation

Overview

templ: version: v0.3.977

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Content

func Content(props ContentProps) templ.Component
func Dropdown(props Props) templ.Component

func Trigger

func Trigger(props TriggerProps) templ.Component

Types

type Align

type Align string

Align controls the dropdown content horizontal alignment.

const (
	AlignDefault Align = ""
	AlignCenter  Align = "dropdown-center"
	AlignEnd     Align = "dropdown-end"
)

type ContentProps

type ContentProps struct {
	DropdownID string
	Class      string
	Attributes templ.Attributes
}

ContentProps configures the dropdown content panel.

type DropdownSignals struct {
	Open bool `json:"open"`
}

DropdownSignals holds the reactive state for a dropdown.

type Position

type Position string

Position controls the dropdown content direction.

const (
	PositionDefault Position = ""
	PositionTop     Position = "dropdown-top"
	PositionBottom  Position = "dropdown-bottom"
	PositionLeft    Position = "dropdown-left"
	PositionRight   Position = "dropdown-right"
)

type Props

type Props struct {
	ID         string
	Class      string
	Attributes templ.Attributes
	Position   Position
	Align      Align
	Hover      bool
}

Props configures a dropdown.

type TriggerProps

type TriggerProps struct {
	DropdownID string
	Class      string
	Attributes templ.Attributes
}

TriggerProps configures the dropdown trigger button.

Jump to

Keyboard shortcuts

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