Workspace and connected results
Workspace data, a connected result, and an embedded page share the same widget structure. These examples use recorded results; no service is connected.
A surface with a subtle 1px outline and 4px corners for React content and provider iframes, with attribution, data states, actions, and supporting context.
Workspace data, a connected result, and an embedded page share the same widget structure. These examples use recorded results; no service is connected.
npm install @noorddev/vlak-react
Load the stylesheet once at your app root, then import the components you use.
import "@noorddev/vlak-react/css";
import { Button, Widget, WidgetEmbed, type WidgetStatus } from "@noorddev/vlak-react";Per-component imports are available at @noorddev/vlak-react/components/widget.
npx @noorddev/vlak-cli add widget
Adds the component and its dependencies to components/vlak/. Follow the StyleX setup to compile the source in your application.
npx shadcn add https://vlak.dev/r/widget.json
Installs the same source through the shadcn CLI.
import { Button, Widget, WidgetEmbed, type WidgetStatus } from "@noorddev/vlak-react";
export function ConnectedWidgets({ status, onRetry, onOpenFiles, embedUrl }: {
status: WidgetStatus;
onRetry: () => void | Promise<void>;
onOpenFiles: () => void;
embedUrl: string;
}) {
return <>
<Widget title="Recent files" provider="Connected drive" status={status} onRetry={onRetry}
emptyMessage="No files match this request." errorMessage="The drive could not be reached."
actions={<Button variant="subtle" onClick={onOpenFiles}>Open files</Button>} footer="Updated just now">
<p>Project brief · Ready for review</p>
</Widget>
<Widget title="Project board" provider="Connected board">
<WidgetEmbed title="Project board from the connected provider" src={embedUrl} height={360} />
</Widget>
</>;
}See the integration example to compose these components with your application's model and data.
A shared surface for application and third-party React content, with explicit data states.
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | ReactNode | Visible name of this widget and its region. | |
provider | ReactNode | Name or linked attribution for the application or integration supplying the content. | |
icon | ReactNode | Optional decorative provider or content mark. | |
description | ReactNode | ||
status | WidgetStatus | "ready" | Application-supplied data state. The widget never fetches data itself. |
statusLabel | string | ||
emptyMessage | string | "No results to show." | |
errorMessage | string | "This widget could not be loaded." | |
onRetry | () => void | Promise<void> | ||
actions | ReactNode | Application-owned controls, rendered after the content. | |
footer | ReactNode | Supporting source, update time, or context below the actions. | |
children | ReactNode |
Also accepts Omit<HTMLAttributes<HTMLElement>, "title">.
The ref reaches HTMLElement.
An explicitly sized provider iframe for a Widget. Permissions and provider messaging remain application-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | string | Descriptive name of the embedded interface, announced to assistive technology. | |
srcrequired | string | Address supplied by the application or its connected provider. |
Also accepts IframeHTMLAttributes<HTMLIFrameElement>.
The ref reaches HTMLIFrameElement.
| Keys | Does |
|---|---|
| Tab | Moves through provider links, ready content, supplied actions, and the error state's retry button |
| Enter, Space | Activates the focused retry button or supplied native button |
| Tab inside an embed | Follows the provider document's native focus order; its keyboard interactions are supplied by that document |
The same styles are available as CSS. Native HTML provides the static presentation; React or application code supplies state updates and actions.
npm install @noorddev/vlak
import "@noorddev/vlak/css";
<section class="rs-widget" aria-labelledby="widget-title" data-status="ready"><header class="rs-widget-header"><div class="rs-widget-heading"><span class="rs-widget-title" id="widget-title">Recent files</span><div class="rs-widget-provider">Connected drive</div></div></header><div class="rs-widget-content"><p class="rs-widget-message">Project brief · Updated today</p></div><div class="rs-widget-footer">Supplied by the connected application</div></section>