Documentation
¶
Overview ¶
templ: version: v0.3.943
templ: version: v0.3.943
Package components provides shared components for templ templates.
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
templ: version: v0.3.943
Index ¶
- func Ago(t time.Time) templ.Component
- func AssetPath(ctx context.Context, path string) (string, error)
- func Authenticated(ctx context.Context) bool
- func Avatar(url *string) templ.Component
- func BareLayout(props BareLayoutProps) templ.Component
- func BlockLink(path templ.SafeURL) string
- func Cookie(ctx context.Context, name string) string
- func CopyableContent() templ.Component
- func CurrentPath(ctx context.Context) string
- func CurrentURL(ctx context.Context) string
- func CurrentURLWithoutQuery(ctx context.Context) string
- func CurrentUserAvatar() templ.Component
- func CurrentUsername(ctx context.Context) (string, error)
- func DeleteButton() templ.Component
- func EditButton() templ.Component
- func ExternalIcon() templ.Component
- func Filter[T ~string](props FilterProps[T]) templ.Component
- func Flashes() templ.Component
- func Identifier(id resource.TfeID) templ.Component
- func IsOwner(ctx context.Context, organization resource.ID) bool
- func IsSiteAdmin(ctx context.Context) bool
- func Layout(props LayoutProps) templ.Component
- func MenuItem(title string, path templ.SafeURL, matchPrefixes ...string) templ.Component
- func SearchDropdown(props SearchDropdownProps) templ.Component
- func SetAllowedOrigins(origins string)
- func Strikethrough(cond bool) templ.Component
- func Table[T any](populator TablePopulator[T], page *resource.Page[T], id string) templ.Component
- func ToBytes(comp templ.Component) []byte
- func ToString(comp templ.Component) string
- func TokenFlashMessage(w gohttp.ResponseWriter, token []byte) error
- func UnpaginatedTable[T any](populator TablePopulator[T], resources []T, id string) templ.Component
- type BareLayoutProps
- type Breadcrumb
- type DropDownUIWidth
- type FilterProps
- type LayoutProps
- type SearchDropdownProps
- type TablePopulator
- type Websocket
- type WebsocketListHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticated ¶
func BareLayout ¶
func BareLayout(props BareLayoutProps) templ.Component
func CopyableContent ¶
func CurrentPath ¶
func CurrentURL ¶
func CurrentURLWithoutQuery ¶
func CurrentUserAvatar ¶ added in v0.3.25
func DeleteButton ¶
func EditButton ¶ added in v0.3.17
func ExternalIcon ¶ added in v0.3.18
func IsSiteAdmin ¶
func Layout ¶
func Layout(props LayoutProps) templ.Component
func SearchDropdown ¶
func SearchDropdown(props SearchDropdownProps) templ.Component
func SetAllowedOrigins ¶ added in v0.3.22
func SetAllowedOrigins(origins string)
SetAllowedOrigins sets the allowed origins for inbound websocket connections. If origins is empty, all origins are allowed. Otherwise origins is expected to be a comma separated list of origins and if the origin on an inbound websocket connection does not match one of those origins then the connection is rejected.
func Strikethrough ¶
func TokenFlashMessage ¶
func TokenFlashMessage(w gohttp.ResponseWriter, token []byte) error
TokenFlashMessage is a helper for rendering a flash message with an authentication token.
func UnpaginatedTable ¶ added in v0.3.17
func UnpaginatedTable[T any](populator TablePopulator[T], resources []T, id string) templ.Component
Types ¶
type BareLayoutProps ¶
type Breadcrumb ¶
type DropDownUIWidth ¶
type DropDownUIWidth string
const ( NarrowDropDown DropDownUIWidth = "narrow" WideDropDown DropDownUIWidth = "wide" )
type FilterProps ¶ added in v0.3.20
type LayoutProps ¶
type SearchDropdownProps ¶
type SearchDropdownProps struct {
// Name to send along with value in the POST form
Name string
// Existing values to NOT show in the dropdown
Existing []string
// Available values to show in the dropdown
Available []string
// Action is the form action URL
Action templ.SafeURL
// Placeholder to show in the input element.
Placeholder string
// Width: "narrow" or "wide"
Width DropDownUIWidth
}
type TablePopulator ¶ added in v0.3.16
TablePopulator populates a table component with resources of type T.
type Websocket ¶ added in v0.3.23
Websocket is an inbound websocket connection, on which snippets of HTML are sent from the server to the client.
func NewWebsocket ¶ added in v0.3.23
type WebsocketListHandler ¶ added in v0.3.15
type WebsocketListHandler[Resource, ResourceEvent, Options any] struct { logr.Logger Client websocketListHandlerClient[Resource, ResourceEvent, Options] Populator TablePopulator[Resource] ID string }
WebsocketListHandler handles dynamically updating lists of resources via a websocket.
func (*WebsocketListHandler[Resource, ResourceEvent, Options]) Handler ¶ added in v0.3.15
func (h *WebsocketListHandler[Resource, ResourceEvent, Options]) Handler(w http.ResponseWriter, r *http.Request)