j3w1 / theme

j3w1 / theme4.0.0

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Workbench
  • SPEC Form builder
  • SPEC Task kit
  • SPEC Recipes
  • SPEC Figma bridge
  • SPEC Report an issue
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • SPEC Specification
  • DEMO Vue application demo

File browser

Location navigation and a filterable native file table with bounded host actions.

stable · light DOM · 4.0.0. Light DOM retains static content, native semantics, label relationships and host composition without duplicating controls.

Live variants

default

  • All files
  • Source
Local file examples
NameKindSize
Vue component4 KB
Documentation2 KB

2 files

Markup
<j3w1-file-browser id="example-file-browser-default"><section class="file-browser" aria-label="Workspace files"><div class="file-browser-locations"><j3w1-tree><ul class="tree" role="tree" aria-label="Locations"><li role="treeitem" tabindex="0" aria-selected="true" data-location="all" id="example-file-browser-default-files-all" data-demo-focus-target=""><span data-tree-label="">All files</span></li><li role="treeitem" tabindex="-1" aria-selected="false" data-location="source" id="example-file-browser-default-files-source"><span data-tree-label="">Source</span></li></ul></j3w1-tree></div><div><label for="example-file-browser-default-files-query">Search files</label><input class="file-browser-control" id="example-file-browser-default-files-query" type="search" data-file-query=""><table><caption>Local file examples</caption><thead><tr><th scope="col">Name</th><th scope="col">Kind</th><th scope="col">Size</th></tr></thead><tbody><tr data-file-id="app" data-location="source"><td><button class="file-browser-control" type="button" data-file-open="app">App.vue</button></td><td>Vue component</td><td>4 KB</td></tr><tr data-file-id="readme" data-location="docs"><td><button class="file-browser-control" type="button" data-file-open="readme">README.md</button></td><td>Documentation</td><td>2 KB</td></tr></tbody></table><p role="status" data-file-status="">2 files</p></div></section></j3w1-file-browser>

Install and register

Use the exact version. If npm publication is pending, install the release tarball from the installation guide.

npm install --save-exact @j3w1/ui@4.0.0
import '@j3w1/ui/tokens.css';
import '@j3w1/ui/styles/file-browser.css';
import '@j3w1/ui/register/file-browser';

Insert the maintained markup above after loading these imports. Its native children provide accessible names and form behavior; the empty custom tag alone does not create a control.

Vue SFC, React, Astro and plain HTML integration →

Copy the complete implementation

npx --package=@j3w1/ui@4.0.0 j3w1-ui copy file-browser --out ./vendor/j3w1/file-browser

The CLI verifies every file before writing and refuses overwrites. Serve the output over HTTP and open index.html. Keep its modules, CSS, tokens and licence notices together.

Public API

attributes

NameType / signatureMeaning
disabledCustomEventDisable the native controls owned by this instance.
loadingCustomEventMark the primary control busy and prevent duplicate activation.

properties

NameType / signatureMeaning
disabledbooleanDelegates disabled state to native children.
namestringNative control name; application form keys remain explicit.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.

events

NameType / signatureMeaning
j3w1-open-fileCustomEventRequest opening an existing file identity.

Dependencies and verification

Registered components: tree. Style dependencies: table, tree.

Package presence establishes an available implementation. Actual passes depend on the tested artifact and environment. Read specification execution evidence; read packed-consumer evidence; inspect the complete state matrix.

Full implementation manifest, API and token dependency closure

Canonical specification

File browser file-browser

  • Family: Composed specimens
  • Maturity: stable
  • Priority: R2
  • Since: 1.0.0
  • Native control: Tree composition, native search input and table
  • specified
  • demonstrated

Location navigation and a filterable native file table with bounded host actions.

Report an issue with this component

Tokens

Focus a role to inspect its values; follow its link for persistent usage and source details.

PartRoleValueUse
root.bgcolor.surface.defaultapproveduse#0d0707D-041 surface.default: color.primitive.modern.panel.
root.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
root.bordercolor.border.controlapproveduse#c81a1aD-041 owner correction: red control and floating-frame borders, distinct from rose text.
heading.textcolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
secondary.textcolor.text.mutedapproveduse#d4868bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
control.bgcolor.surface.inputapproveduse#000000Form-control fill.
control.focuscolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
button.bgcolor.action.secondary.bgobservedusergb(0 0 0 / 0%)Secondary button has no fill.
button.textcolor.action.secondary.textapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
button.bordercolor.action.secondary.borderapproveduse#986f72D-041 action.secondary.border: color.primitive.modern.control.
button.bg-hovercolor.action.secondary.hover-bgobserveduse#630f0dSecondary button hover.
button.bg-activecolor.action.secondary.pressed-bgobserveduse#420f0cSecondary button pressed.
button.border-activecolor.border.activeobserveduse#e53935Active or focused control border.
button.focuscolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
dependency.role-border-width-defaultborder.width.defaultobserveduse1pxEvery border is 1px.
dependency.role-border-width-emphasisborder.width.emphasisobserveduse2pxSelected indicator, sticky header rule, invalid border.
dependency.role-color-border-dividercolor.border.dividerapproveduse#482b2bD-041 border.divider: color.primitive.modern.divider.
dependency.role-color-border-selected-indicatorcolor.border.selected-indicatorobserveduse#e539352px indicator bar on the selected tab or nav item.
dependency.role-density-comfortable-control-heightdensity.comfortable.control-heightobserveduse32px
dependency.role-density-compact-control-heightdensity.compact.control-heightobserveduse24px
dependency.role-focus-offsetfocus.offsetobserveduse-2pxoutline-offset for controls.
dependency.role-radius-noneradius.noneobserveduse0pxThe only radius. Nothing is rounded.
dependency.role-space-12space.12observeduse12px
dependency.role-space-16space.16observeduse16px
dependency.role-space-8space.8observeduse8px

State matrix

Every declared state and combination, statically rendered; the default cell is live. Sizes: compact, comfortable (switch with the density control above).

StateDefault
default
  • All files
  • Source
Local file examples
NameKindSize
Vue component4 KB
Documentation2 KB

2 files

selected
empty
no-results
focus-visible

Purpose

Finds a file by location and name; every file operation belongs to the caller.

Anatomy

Parts as listed in the anatomy.

States

StateVisualNon-colour channel
defaultLocations and native file rows. Button controls are the secondary button (button.md); inputs keep the input look.Explicit names, kinds and sizes.
selectedSelected location follows the tree contract.aria-selected plus location filter.
emptyNo file rows.Explicit zero-files text.
no-resultsFiltered rows are hidden.Matching count and retained search query.
focus-visibleDashed control outline.Native focus and tree roving focus.

Keyboard

As in the key table.

Accessibility

Keep the complete nested tree behaviour and semantic table headers. Filtering does not move focus. Announce counts, and keep the search field available after zero results. File actions never imply access beyond the host’s actual permissions.

Portability

Follows the shared component defaults in spec/portability.md (section “Shared component defaults”).

Non-examples

Unlabelled controls, color-only status, drag-only operations, hidden required instructions, stolen focus or an invented service success.

Contrast report

7 declared pairs measured on resolved sRGB values with the WCAG 2.x formula; 0 waived (decorative only), 0 failing. A pass is a design target for the named role, not an application-wide conformance claim.

PairStateKindForegroundBackgroundRatioMinResult
file-browser default textdefaulttextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
file-browser default borderdefaultuicolor.border.control #c81a1acolor.surface.default #0d07073.443pass
Primary content—textcolor.text.default #e99499color.surface.default #0d07078.724.5pass
Supporting content—textcolor.text.muted #d4868bcolor.surface.default #0d07077.224.5pass
Control boundary—uicolor.border.control #c81a1acolor.surface.default #0d07073.443pass
Button label—textcolor.action.secondary.text #ffa2a7color.surface.default #0d070710.454.5pass
Button label on hover—textcolor.action.secondary.text #ffa2a7color.action.secondary.hover-bg #630f0d6.844.5pass

Keys

KeyAction
Tab / Shift+TabMove among tree navigation, search and row actions.
Arrow keysUse the tree contract inside navigation.
Enter / SpaceRequest opening the chosen file through an event.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: tree table search-field

Stress fixtures: FX-320 FX-360 FX-ZOOM-200 FX-I18N FX-RTL FX-RM FX-HC FX-TOUCH FX-DENSITY FX-STATE-MATRIX