Documentation ¶
Index ¶
- Variables
- func Next(p PaginationProps) htmx.Node
- func Pagination(p PaginationProps, children ...htmx.Node) htmx.Node
- func PaginationPropsFromContext(c *fiber.Ctx) (limit int, offset int)
- func Prev(p PaginationProps) htmx.Node
- func Select(p SelectProps, children ...htmx.Node) htmx.Node
- func Table[R comparable](p TableProps[R], children ...htmx.Node) htmx.Node
- func TablePagination[R comparable](p TablePaginationProps[R], children ...htmx.Node) htmx.Node
- func TableToolbar[R comparable](p TableToolbarProps[R], children ...htmx.Node) htmx.Node
- type ColumnDef
- type Columns
- type PaginationProps
- type Rows
- type SelectProps
- type TablePaginationProps
- type TableProps
- type TableToolbarProps
Constants ¶
This section is empty.
Variables ¶
var DefaultLimits = []int{5, 10, 25, 50}
DefaultLimits is a list of default limits
Functions ¶
func Pagination ¶ added in v1.0.22
func Pagination(p PaginationProps, children ...htmx.Node) htmx.Node
Pagination ...
func PaginationPropsFromContext ¶ added in v1.0.32
PaginationFromContext returns a new Pagination object based on the provided context.
func Select ¶ added in v1.0.32
func Select(p SelectProps, children ...htmx.Node) htmx.Node
Select ...
func Table ¶
func Table[R comparable](p TableProps[R], children ...htmx.Node) htmx.Node
Table is a struct that contains the properties of a table
func TablePagination ¶ added in v1.0.32
func TablePagination[R comparable](p TablePaginationProps[R], children ...htmx.Node) htmx.Node
TablePagination is a component that renders a table pagination
func TableToolbar ¶ added in v1.0.32
func TableToolbar[R comparable](p TableToolbarProps[R], children ...htmx.Node) htmx.Node
TableToolbar is a component that renders a table toolbar
Types ¶
type ColumnDef ¶
type ColumnDef[R comparable] struct { ID string AccessorKey string Header func(p TableProps[R]) htmx.Node Cell func(p TableProps[R], row R) htmx.Node EnableSorting bool EnableFiltering bool }
ColumnDef returns a new column definition.
type PaginationProps ¶ added in v1.0.32
type PaginationProps struct { ClassName htmx.ClassNames Limit int Offset int Target string Total int URL string }
PaginationProps is a struct that contains the properties of a pagination
type Rows ¶
type Rows[R comparable] struct { Data []R }
Rows is a struct that contains the data of a table
func (*Rows[R]) ValueByIndex ¶
ValueByIndex is a helper function that returns the value of a row based on the provided index.
type SelectProps ¶ added in v1.0.32
type SelectProps struct { ClassNames htmx.ClassNames Limit int Limits []int Offset int Target string Total int URL string }
SelectProps ...
type TablePaginationProps ¶ added in v1.0.32
type TablePaginationProps[R comparable] struct { ClassName htmx.ClassNames Pagination htmx.Node }
TablePaginationProps is a struct that contains the properties of a table pagination
type TableProps ¶
type TableProps[R comparable] struct { ClassName htmx.ClassNames Columns Columns[R] ID string Pagination htmx.Node Rows Rows[R] Toolbar htmx.Node }
TableProps is a struct that contains the properties of a table
type TableToolbarProps ¶ added in v1.0.32
type TableToolbarProps[R comparable] struct { ClassName htmx.ClassNames }
TableToolbarProps is a struct that contains the properties of a table toolbar