pagination

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bar

func Bar(props BarProps) templ.Component

Bar renders a complete Previous/page-numbers/Next pager, or nothing if the results fit on a single page.

func Content

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

func CreatePagination

func CreatePagination(currentPage, totalPages, maxVisible int) struct {
	CurrentPage int
	TotalPages  int
	Pages       []int
	HasPrevious bool
	HasNext     bool
}

func Ellipsis

func Ellipsis() templ.Component

func Item

func Item(props ...ItemProps) templ.Component
func Link(props ...LinkProps) templ.Component

func Next

func Next(props ...NextProps) templ.Component

func Pagination

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

func Previous

func Previous(props ...PreviousProps) templ.Component

Types

type BarProps

type BarProps struct {
	BasePath   string
	Query      url.Values
	Page       int
	PerPage    int
	TotalItems int
}

BarProps holds the data needed to render a full pager for a paginated list. Query should hold every filter to preserve across page links (search, per_page if non-default, etc.) but must NOT include "page" itself.

type ContentProps

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

type ItemProps

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

type LinkProps

type LinkProps struct {
	ID         string
	Class      string
	Attributes templ.Attributes
	Href       string
	IsActive   bool
	Disabled   bool
}

type NextProps

type NextProps struct {
	ID         string
	Class      string
	Attributes templ.Attributes
	Href       string
	Disabled   bool
	Label      string
}

type PreviousProps

type PreviousProps struct {
	ID         string
	Class      string
	Attributes templ.Attributes
	Href       string
	Disabled   bool
	Label      string
}

type Props

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

Jump to

Keyboard shortcuts

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