Why single-file components
A component that is one HTML file can be previewed by an iframe, read in a sitting, and pasted into any stack - no build step, no dependency graph, nothing fetched at runtime. That is the whole premise of the library this page edits.
What the sandbox allows
The frame runs scripts so a component's own behaviour works, and it is denied same-origin access, forms, popups and navigation. A pasted component cannot read this page, its storage or your cookies.
Check dark and RTL before shipping
Both switches rewrite the document's own attributes rather than forcing styles from outside, so what you see is what the file does on its own. A layout that only mirrors correctly because the parent page helped it is a layout that will break elsewhere.