npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

filetree-indokudev

v1.1.1

Published

Custom file tree component for React

Downloads

9

Readme

@filetree-indokudev/react

A powerful, customizable file tree component for React applications with VSCode-like functionality.

Features

  • 🎯 VSCode-like Interface - Familiar file explorer experience
  • 🎨 Theme Support - Light, dark, and auto themes with localStorage persistence
  • 🖱️ Context Menu - Right-click or long-press (2s) for context actions
  • 🔄 Drag & Drop - Full drag and drop support for file operations
  • 📁 File Type Icons - Automatic icons for different file types
  • ✏️ Inline Rename - Double-click to rename files and folders
  • 📱 Responsive - Works on desktop and mobile devices
  • 🔧 Highly Customizable - Easy to customize and extend
  • 📦 TypeScript - Full TypeScript support
  • 🚀 Lightweight - Minimal dependencies

Installation

```bash npm install @filetree-indokudev/react ```

Quick Start

```tsx import React, { useState } from 'react'; import { FileTree, FileTreeNode } from '@filetree-indokudev/react';

const data: FileTreeNode[] = [ { id: '1', name: 'src', type: 'folder', path: '/src', isExpanded: true, children: [ { id: '2', name: 'App.tsx', type: 'file', path: '/src/App.tsx', extension: 'tsx' } ] } ];

function App() { const [treeData, setTreeData] = useState(data);

return ( <FileTree data={treeData} onNodeSelect={(node) => console.log('Selected:', node)} onNodeExpand={(node) => console.log('Expanded:', node)} onNodeRename={(node, newName) => console.log('Renamed:', node, newName)} theme="auto" showIcons={true} allowDragDrop={true} allowRename={true} /> ); } ```

Props

FileTree Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | FileTreeNode[] | Required | Array of file tree nodes | | onNodeSelect | (node: FileTreeNode) => void | - | Called when a node is selected | | onNodeExpand | (node: FileTreeNode) => void | - | Called when a folder is expanded/collapsed | | onNodeRename | (node: FileTreeNode, newName: string) => void | - | Called when a node is renamed | | onNodeDelete | (node: FileTreeNode) => void | - | Called when a node is deleted | | onNodeCopy | (node: FileTreeNode) => void | - | Called when a node is copied | | onNodeCut | (node: FileTreeNode) => void | - | Called when a node is cut | | onNodePaste | (targetNode: FileTreeNode, sourceNode: FileTreeNode) => void | - | Called when a node is pasted | | onNodeDrop | (draggedNode: FileTreeNode, targetNode: FileTreeNode) => void | - | Called when a node is dropped | | onNodeProperties | (node: FileTreeNode) => void | - | Called when properties is selected | | onNodeOpenWith | (node: FileTreeNode) => void | - | Called when "open with" is selected | | theme | 'light' \| 'dark' \| 'auto' | 'auto' | Theme mode | | showIcons | boolean | true | Show file type icons | | allowDragDrop | boolean | true | Enable drag and drop | | allowRename | boolean | true | Allow renaming nodes | | allowDelete | boolean | true | Allow deleting nodes | | className | string | '' | Additional CSS classes | | customContextMenu | ContextMenuAction[] | [] | Custom context menu actions |

FileTreeNode Interface

```tsx interface FileTreeNode { id: string; name: string; type: 'file' | 'folder'; path: string; children?: FileTreeNode[]; size?: number; modified?: Date; extension?: string; isExpanded?: boolean; isSelected?: boolean; isEditing?: boolean; } ```

Context Menu Actions

The component provides these built-in context menu actions:

  • Rename (F2) - Rename the selected item
  • Cut (Ctrl+X) - Cut the selected item
  • Copy (Ctrl+C) - Copy the selected item
  • Paste (Ctrl+V) - Paste the copied/cut item
  • Delete (Del) - Delete the selected item
  • Open with... - Open with external application
  • Properties (Alt+Enter) - Show item properties

Supported File Types

The component automatically detects and displays appropriate icons for:

  • JavaScript/TypeScript: .js, .jsx, .ts, .tsx, .mjs
  • Web: .html, .css, .scss, .sass, .less
  • Frameworks: .vue, .svelte
  • Data: .json, .xml, .yaml, .yml, .toml
  • Images: .png, .jpg, .jpeg, .gif, .svg, .webp, .ico
  • Video: .mp4, .avi, .mov, .wmv, .webm
  • Audio: .mp3, .wav, .flac, .ogg
  • Archives: .zip, .rar, .7z, .tar, .gz
  • Documents: .pdf, .doc, .docx, .txt, .md, .rtf
  • And many more...

Theming

The component supports three theme modes:

  • light - Light theme
  • dark - Dark theme
  • auto - Automatically follows system preference

Theme preference is automatically saved to localStorage.

Customization

Custom Context Menu

```tsx const customActions: ContextMenuAction[] = [ { id: 'custom-action', label: 'Custom Action', icon: 'Star', onClick: (node) => console.log('Custom action:', node) } ];

```

Custom Styling

The component uses Tailwind CSS classes and can be customized by overriding the default styles or by passing custom className props.

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © IndokuDev ```