Skip to content

Make an option to collapse an embedded iframe #70

Open
@jasongrout

Description

Problem

An embedded retrolite or jlab iframe is really valuable to have in a docs page as it provides the user an immediate opportunity to interact, but it comes with a heavy download cost that projects may not want to pay, particularly on their front docs page. However, providing only a link to a separate retrolite page may stifle user engagement too much by requiring an extra click and navigation away from the current page.

Proposed Solution

Provide an option for embedded iframes to be initially collapsed with an HTML details element, like this:

<details><summary>Try it now!</summary>[embedded iframe]</details>
Try it now![embedded iframe]

We could even lazily create the iframe with a bit of javascript that listens for the details toggle event, so the initial page load doesn't automatically trigger a heavy download of retrolite.

Additional context

This came up in a discussion in ipyleaflet about whether we should have an embedded retrolite on the front page of the docs (see jupyter-widgets/ipyleaflet#1007 (comment)). The idea of using a details element was suggested by @williamstein when we were discussing putting an embedded retrolite on the front page of the ipywidgets documentation.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions