disclosure

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package disclosure renders a single styled <details>/<summary> disclosure section. Use it for one-off "click to reveal" content (FAQ rows, expandable help, advanced-options panels). Accordion composes Group + Stack of these; this is the primitive.

Output:

<details data-fui-comp="ui-disclosure" class="ui-disclosure">
  <summary class="ui-disclosure__summary">Title</summary>
  <div class="ui-disclosure__body">…</div>
</details>

Native semantics — keyboard, screen reader, "find in page" expansion all work without JavaScript.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(cfg Config, body ...render.HTML) render.HTML

Render renders the disclosure with the given body content.

Types

type Config

type Config struct {
	// Title is the always-visible summary text (required).
	Title string
	// Open opts the disclosure into rendering open by default.
	Open bool
	// ID / Class / Attrs are passed through to the <details>.
	ID         string
	Class      string
	ExtraAttrs html.Attrs
}

Config configures a Disclosure.

Jump to

Keyboard shortcuts

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