Skip to content

/get-started/react/

Draw it with @vol-a/react

@vol-a/react is the interface for one instance of your application, for example the files of one ticket. Every request goes through a VolaClient.

App.tsx
import "@jsudc/react/styles.css";
import "@vol-a/react/styles.css";
import { VolaClient } from "@vol-a/client";
import { VolaFileBrowser, VolaPinGate, VolaProvider } from "@vol-a/react";
// The files of one ticket: folders, thumbnails, uploads, share links, kept live over a WebSocket.
// `/vola` is your own origin, proxied to vola; the key needs `files:read`, the actions their scopes.
export function TicketFiles({ apiKey, ticketId }: { apiKey: string; ticketId: string }) {
const vola = new VolaClient({ baseUrl: "/vola", apiKey, userId: "user-42" });
return (
<VolaProvider client={vola} locale="en">
<VolaPinGate>
<VolaFileBrowser instanceType="tickets" instanceId={ticketId} />
</VolaPinGate>
</VolaProvider>
);
}

The Browse example is this component running against a demo instance.

Component What it draws
VolaProvider Nothing itself: the client, English and Serbian strings, the data view’s providers, the keyring store and its auto-lock
VolaFileBrowser Breadcrumbs, subfolders, a live table with search and filters, row actions and a drop zone
VolaUploadButton, useVolaUpload Plain uploads under 8 MiB, resumable above, with progress, cancel and resume after a reload
VolaThumb A thumbnail that waits out the 202 with a backoff and never caches the placeholder
VolaPinGate, useVolaKeyring PIN setup with the recovery key shown once, unlock, wrong attempts, the lock-out countdown, recovery and reset
VolaShareDialog Password, expiry, download cap, copy, list and revoke

The peers and every prop are in the package README.

v1.1.0released built 402bea0