jsonview

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

templ: version: v0.3.977

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONView

func JSONView(props Props) templ.Component

JSONView renders a formatted, syntax-highlighted JSON viewer. If Value is valid JSON, it is pretty-printed with color-coded tokens. If not, the raw value is displayed as-is. When Copyable is true, a copy button appears that copies the raw JSON text.

Types

type CopySignals added in v0.0.9

type CopySignals struct {
	Copied bool `json:"copied"`
}

CopySignals holds the reactive state for the copy button.

type Props

type Props struct {
	ID         string
	Class      string
	Attributes templ.Attributes
	Value      string // raw value to display (JSON or plain text)
	Copyable   bool   // show a copy-to-clipboard button
}

Jump to

Keyboard shortcuts

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