File Tree
Expand folders and preview a selected file with native disclosure controls.
Studio collection
Product sheets
Photography
HTML
<section class="rl-file-tree"><details open><summary>Studio collection</summary><ul><li><details open><summary>Product sheets</summary><ul><li><button type="button" class="rl-file" data-file-preview="Arc Task Lamp · Powder-coated steel. Finish options include ivory, sand and graphite.">arc-task-lamp.txt</button></li><li><button type="button" class="rl-file" data-file-preview="Forma Vase · Hand-finished glazed stoneware. Packaging dimensions: 20 × 20 × 28 cm.">forma-vase.txt</button></li></ul></details></li><li><details><summary>Photography</summary><ul><li><button type="button" class="rl-file" data-file-preview="Shoot the front, profile and detail angles against the graphite background.">shot-list.md</button></li></ul></details></li></ul></details><output aria-live="polite">Select a file to preview its contents.</output></section>Use in your app
Copy these tags into your page head once. Serve the files at the paths shown, then add the example’s template to your page.
Page assets
<link rel="stylesheet" href="/mero.css">
<link rel="stylesheet" href="/mero-collections.css">
<script defer src="/mero.js"></script>
<script defer src="/mero-collections.js"></script>