Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-file-explorer>

@methane-ui/admin~9.0 KB brotli (kit + Lit)~2.6 KB marginal

File and folder explorer (<mth-file-explorer>) with hierarchical folder tree, clickable path breadcrumbs, list/grid views, multi-select, and 2D RTL-aware keyboard navigation.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-file-explorer> (@methane-ui/admin)
Ready · interact with <mth-file-explorer>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/admin/file-explorer"></script>
<mth-file-explorer view-mode="list" columns="3">Example</mth-file-explorer>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
items—ReadonlyArray<unknown>—Flat list of files and folders linked via parentId.
currentFolderIdcurrent-folder-idstring | null—Active directory ID (null for root).
viewModeview-mode'list' | 'grid'"list"Layout mode (list or grid).
columnscolumnsnumber3Number of grid columns when viewMode="grid".

Events

EventDetail TypeDescription
mth-navigate{ folderId: string | null }Emitted when navigating to another folder.
mth-file-open{ item: unknown }Emitted when opening a file.
mth-selection-change{ selectedIds: ReadonlyArray<string> }Emitted when the selected item IDs change.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightbothan entry has focusmoves focus to next entry (or previous in RTL)
ArrowLeftbothan entry has focusmoves focus to previous entry (or next in RTL)
ArrowDownbothan entry has focusmoves focus down in list or grid
ArrowUpbothan entry has focusmoves focus up in list or grid
Homebothan entry has focusfocuses the first entry
Endbothan entry has focusfocuses the last entry

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 6 APG keyboard transitions across LTR/RTL.mth-file-explorer.spec.test.ts
i18nRoutes 11 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test