ax

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(attr string, v string) htm.Mod

Bind sets the value of an attribute to the result of a JavaScript expression.

func BindValue

func BindValue(value htm.TypedValue) htm.Mod

BindValue applies an object of attributes to the element (e.g. x-bind="{...}").

func Cloak

func Cloak(v ...bool) htm.Mod

Cloak hides the element until Alpine has fully initialized.

func Data

func Data(value ...htm.TypedValue) htm.Mod

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

func Effect

func Effect(v string) htm.Mod

Effect allows to react to changes in data by running a callback.

func For

func For(v string) htm.Mod

For allows to iterate over an array or object to create DOM elements. Must be used on a <template> tag.

func HTML

func HTML(v string) htm.Mod

HTML sets the inner HTML of an element to the result of a JavaScript expression.

func ID

func ID(v string) htm.Mod

ID allows to declare a new scope for $id().

func If

func If(v string) htm.Mod

If allows to toggle an element in and out of the DOM based on a JS expression. Must be used on a <template> tag.

func Ignore

func Ignore(v ...bool) htm.Mod

Ignore prevents Alpine from initializing elements within a block of HTML.

func Init

func Init(value ...htm.TypedValue) htm.Mod

Init runs an expression when the component is initialized.

func Key

func Key(v string) htm.Mod

func Model

func Model(v string) htm.Mod

Model binds the value of an input element to a specific data property.

func ModelValue

func ModelValue(modifiers string, v htm.TypedValue) htm.Mod

ModelValue binds the value of an input element to a specific data property. It also allows to pass optional modifiers.

func Modelable

func Modelable(v string) htm.Mod

Modelable allows to expose any Alpine property as the target of an x-model directive.

func On

func On(event string, v string) htm.Mod

On attaches an event listener to the element.

func Ref

func Ref(name string) htm.Mod

Ref allows to reference elements directly in JavaScript using $refs.

func SetBind

func SetBind(n *htm.Node, attr string, v string)

SetBind sets an x-bind:[attr] attribute on the node.

func SetBindValue

func SetBindValue(n *htm.Node, value htm.TypedValue)

SetBindValue sets the x-bind attribute (object syntax) on the node.

func SetCloak

func SetCloak(n *htm.Node, v ...bool)

SetCloak sets the x-cloak attribute on the node.

func SetData

func SetData(n *htm.Node, value ...htm.TypedValue)

SetData sets the x-data attribute on the node.

func SetEffect

func SetEffect(n *htm.Node, v string)

SetEffect sets the x-effect attribute on the node.

func SetFor

func SetFor(n *htm.Node, v string)

SetFor sets the x-for attribute on the node.

func SetHTML

func SetHTML(n *htm.Node, v string)

SetHTML sets the x-html attribute on the node.

func SetID

func SetID(n *htm.Node, v string)

SetID sets the x-id attribute on the node.

func SetIf

func SetIf(n *htm.Node, v string)

SetIf sets the x-if attribute on the node.

func SetIgnore

func SetIgnore(n *htm.Node, v ...bool)

SetIgnore sets the x-ignore attribute on the node.

func SetInit

func SetInit(n *htm.Node, value ...htm.TypedValue)

SetInit sets the x-init attribute on the node.

func SetKey

func SetKey(n *htm.Node, v string)

func SetModel

func SetModel(n *htm.Node, v string)

SetModel sets the x-model attribute on the node.

func SetModelValue

func SetModelValue(n *htm.Node, modifiers string, v htm.TypedValue)

SetModelValue sets the x-model attribute on the node. It also allows to pass optional modifiers.

func SetModelable

func SetModelable(n *htm.Node, v string)

SetModelable sets the x-modelable attribute on the node.

func SetOn

func SetOn(n *htm.Node, event string, v string)

SetOn sets an x-on:[event] attribute on the node.

func SetRef

func SetRef(n *htm.Node, name string)

SetRef sets the x-ref attribute on the node.

func SetShow

func SetShow(n *htm.Node, v string)

SetShow sets the x-show attribute on the node.

func SetTeleport

func SetTeleport(n *htm.Node, selector string)

SetTeleport sets the x-teleport attribute on the node.

func SetText

func SetText(n *htm.Node, v string)

SetText sets the x-text attribute on the node.

func SetTransition

func SetTransition(n *htm.Node, modifier ...string)

SetTransition sets the x-transition attribute on the node.

func SetTransitionStage

func SetTransitionStage(n *htm.Node, stage string, classes string)

SetTransitionStage applies specific transition classes (e.g. x-transition:enter="..."). Stages: enter, enter-start, enter-end, leave, leave-start, leave-end.

func Show

func Show(v string) htm.Mod

Show toggles the visibility of an element based on the truthiness of a JavaScript expression.

func Teleport

func Teleport(selector string) htm.Mod

Teleport allows to transport part of template to another part of the DOM. selector: the DOM selector to append the content to (e.g. "body").

func Text

func Text(v string) htm.Mod

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

func Transition

func Transition(modifier ...string) htm.Mod

Transition enables standard transitions on an element.

func TransitionStage

func TransitionStage(stage string, classes string) htm.Mod

TransitionStage applies specific transition classes (e.g. x-transition:enter="..."). Stages: enter, enter-start, enter-end, leave, leave-start, leave-end.

Types

This section is empty.

Jump to

Keyboard shortcuts

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