okrzejahauru.club/x/okrzeja/web/view/alpine Index | Files

package alpine

import "hauru.club/x/okrzeja/web/view/alpine"

Package alpine implements HTML gomponents attributes for alpinejs, lightweight JavaScript framework.

Index

Functions

func Bind

func Bind(value ...string) g.Node

Bind allows you to bind an object of different directives and attributes to an element.

See: https://alpinejs.dev/directives/bind#bind-directives for official documentation.

func BindAttr

func BindAttr(attr, expr string) g.Node

BindAttr allows you to set HTML attributes on elements based on the result of JavaScript expressions.

See: https://alpinejs.dev/directives/bind for official documentation.

func Data

func Data(value ...string) g.Node

Data defines a chunk of HTML as an Alpine component and provides the reactive data for that component to reference.

See: https://alpinejs.dev/directives/data for official documentation.

func For

func For(item, index, items string) g.Node

For directive allows you to create DOM elements by iterating through a list.

See: https://alpinejs.dev/directives/for for official documentation.

func ID

func ID(ids ...string) g.Node

ID allows you to declare a new "scope" for any new IDs generated using $id(). It accepts an array of strings (ID names) and adds a suffix to each $id('...') generated within it that is unique to other IDs on the page.

See: https://alpinejs.dev/directives/id for official documentation.

func Model

func Model(expr string) g.Node

Model allows you to bind the value of an input element to Alpine data.

See: https://alpinejs.dev/directives/model for official documentation.

func On

func On(event, expr string) g.Node

On allows you to easily run code on dispatched DOM events.

See: https://alpinejs.dev/directives/on for official documentation.

func Ref

func Ref(expr string) g.Node

Ref in combination with $refs is a useful utility for easily accessing DOM elements directly. It's most useful as a replacement for APIs like getElementById and querySelector.

See: https://alpinejs.dev/directives/ref for official documentation.

func Show

func Show(expr string) g.Node

Show is one of the most useful and powerful directives in Alpine. It provides an expressive way to show and hide DOM elements.

See: https://alpinejs.dev/directives/show for official documentation.

func Text

func Text(expr string) g.Node

Text sets the text content of an element to the result of a given expression.

See: https://alpinejs.dev/directives/text for official documentation.

Source Files

alpine.go

Version
v0.0.0-20231010043146-4292577f982b (latest)
Published
Oct 10, 2023
Platform
linux/amd64
Imports
3 packages
Last checked
2 days ago

Tools for package owners.