VirtualTreeProvider
Provides a filesystem tree and desktop display settings.
import { VirtualTreeProvider } from 'filedom';
<VirtualTreeProvider showLabels={false} hideExtensions>
{children}
</VirtualTreeProvider>
Read the tree with useVirtualTree and the display settings with useDesktopSettings.
The provider sets Finder’s desktop label visibility to showLabels and turns labels back on when it unmounts.
Props
PropType
childrenReact.ReactNode
Components using the tree or display settings.
Type
React.ReactNodedesktopPath?string
Directory to scan. Defaults to ~/Desktop.
Type
stringshowLabels?boolean
Show desktop icon labels. Default false.
Type
booleanhideExtensions?boolean
Value of hideExtensions returned by useDesktopSettings. Default false.
Type
boolean