data

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package data provides helpers for building HTML data-* attributes in templ components.

It wraps props.Attrs to allow creating chainable, semantic data attributes such as "data-id", "data-role", or custom attributes.

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key added in v0.5.0

type Key = string
const Data Key = "data"

type Props

type Props struct {
	props.Attrs
}

Props wraps props.Attrs to provide helpers for managing HTML data-* attributes.

func (Props) With

func (p Props) With(key, val string) Props

With adds a data-* attribute with the given key and value. The key is automatically prefixed with "data-".

Jump to

Keyboard shortcuts

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