Components
Provider
Provider components compose permission, selection, drag and drop, view state, and provider context.
The provider is the heart of a Drive screen.
Example responsibilities of LocalDriveProvider
- wraps
Allowed - creates selection context
- creates view context
- enables drag and drop moves
- mounts the upload zone
- passes namespace, permission, and meta through provider context
Shared provider data
Both providers eventually expose a common context shape:
namespacepermissionmeta
That small shared context is deliberate. It keeps feature-specific state out of the core provider contract and lets the package push things like selection and view mode into dedicated contexts.
Drag and drop behavior
Both providers reuse DriveDragDropProvider.
Two implementation details matter in practice:
- dragging only activates after 35 pixels of movement, to reduce accidental drags
- dropping on the root container maps the target to
parentId: null
That gives you a reasonable default folder-move behavior without writing dnd plumbing per screen.
Keep provider props close to the page boundary rather than scattering them across child widgets.