Helix
Triumph TechLava DocsRock Styling
  • Getting Started
    • 👋Welcome
    • Overview
    • Customizing Rock
    • Plugin Installation
    • FAQ
    • Roadmap
    • 🚨Security
  • HTMX
    • Learning More
    • Syntax Style Guide
  • Lava Applications
    • Overview
    • Applications
    • Endpoints
    • Content Block
    • Magnus
    • Observability
  • Lava Commands
    • Delete Entity
    • Modify Entity
    • DB Transaction
    • HTTP Response
    • Render Lava Endpoint
  • Forms & Controls
    • Understanding Forms
    • Using Form Controls
    • Creating New Controls
    • Form Validation
    • Loading Indicator
  • Strategies
    • Tips
    • Related Entities
    • Limitations
Powered by GitBook
On this page
  1. HTMX

Syntax Style Guide

PreviousLearning MoreNextOverview

Last updated 1 year ago

They say if you're going to do something, do it with style—and we believe that applies to coding as well. HTMX's strength lies in its preference for attributes over coding, though this can be a bit overwhelming at first. To enhance readability, we recommend adopting the following syntax style.

<a class="btn btn-primary btn-xs"
    hx-post="^/cato/link-client?ClientGuid={{ client.Guid }}&OrganizationGuid={{ organization.Guid }}"
    hx-target="closest .unlinked-client"
    hx-swap="outerHTML swap:1s"
    hx-swap="outerHTML">{{ organization.Name }}</a>

Note the following:

  1. Put one attribute per line.

  2. The first attribute should be for CSS style classes.