Details

Native disclosure block (details). Renders as <details> with <summary> plus body text. JSON data: { summary: string, content: string, open?: boolean, ...common }.

Type: details · Class: DetailsBlock

Access:

app.block.get()
app.blocks.findByEl(el)
app.blocks.create(type)

App code:

const block = app.block.get();

Plugin:

const block = this.app.block.get();

getData#

Returns the serializable JSON data object for this block, including type-specific fields.

Returns: object

block.getData();

update#

Applies common fields, then updates the summary label, body text, and/or open state.

Parameters:

  • data (object) — object with the keys below
    • summary (string) — text of the <summary> element
    • content (string) — plain-text body after the summary (replaces existing siblings)
    • open (boolean) — sets or removes the open attribute
    • id, classname, styles, attrs, … — common block fields (see Common update)

Returns: void

block.update({ summary: 'More info' });

block.update({ content: 'Expanded details go here.' });

block.update({ open: true });

block.update({
    summary: 'Shipping',
    content: 'Ships within 2–3 days.',
    open: false
});