Skip to content

lpil/flixi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flixi

Use the fixi.js hypermedia library with Lustre!

Package Version Hex Docs

gleam add flixi@1
import flixi
import lustre/element.{type Element}
import gleam/http
import lustre/attribute
import lustre/element/html

pub fn fixi_button() -> List(Element(a)) {
  let attributes = [
    // The URL to issue request to
    flixi.action("/content"),
    // The HTTP Method to use
    flixi.method(http.Get),
    // The event that triggers the request
    flixi.trigger("click"),
    // The element to swap
    flixi.target("#output"),
    // How to swap the element
    flixi.swap("innerHTML"),
  ]
  [
    html.button(attributes, [html.text("Get Content")]),
    html.output([attribute.id("output")], []),
  ]
}

Further documentation can be found at https://hexdocs.pm/flixi.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors