Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@github/details-menu-element
Advanced tools
A menu that's opened with a <details> button.
$ npm install @github/details-menu-element
import '@github/details-menu-element'
<details>
<summary>Robots</summary>
<details-menu>
<ul>
<li><button type="button" role="menuitem">Hubot</button></li>
<li><button type="button" role="menuitem">Bender</button></li>
<li><button type="button" role="menuitem">BB-8</button></li>
</ul>
</details-menu>
</details>
Use data-menu-button
and data-menu-button-text
to have button text updated on menu item activation.
<details>
<summary>Preferred robot: <span data-menu-button>None</span></summary>
<details-menu>
<ul>
<li><button type="button" role="menuitem" data-menu-button-text>Hubot</button></li>
<li><button type="button" role="menuitem" data-menu-button-text>Bender</button></li>
<li><button type="button" role="menuitem" data-menu-button-text>BB-8</button></li>
</ul>
</details-menu>
</details>
Menu content can be loaded from a server by embedding an
<include-fragment>
element.
<details>
<summary>Robots</summary>
<details-menu src="/robots">
<include-fragment>Loading…</include-fragment>
</details-menu>
</details>
The src
attribute value is copied to the <include-fragment>
the first
time the <details>
button is toggled open, which starts the server fetch.
Browsers without native custom element support require a polyfill.
npm install
npm test
Distributed under the MIT license. See LICENSE for details.
FAQs
A menu opened with a <details> button.
We found that @github/details-menu-element demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.