Svelte UI components for status tracking and user feedback in Gradio applications
npx @tessl/cli install tessl/npm-gradio--statustracker@0.10.0@gradio/statustracker provides Svelte UI components for status tracking and user feedback in Gradio applications. It includes comprehensive status tracking with progress indicators, toast notifications, loading animations, and streaming progress bars designed to integrate seamlessly with Gradio interfaces.
import { StatusTracker, Toast, Loader, StreamingBar } from "@gradio/statustracker";
import type { LoadingStatus, ToastMessage } from "@gradio/statustracker";For individual component imports:
import StatusTracker from "@gradio/statustracker"; // Default export
import { ToastContent } from "@gradio/statustracker"; // Individual toast componentimport { StatusTracker, Toast, type LoadingStatus, type ToastMessage } from "@gradio/statustracker";
// StatusTracker usage
const statusProps: Partial<LoadingStatus> = {
status: "pending",
queue_position: 2,
queue_size: 5,
eta: 10,
show_progress: "full"
};
// Toast notifications
const toastMessages: ToastMessage[] = [
{
type: "success",
title: "Success",
message: "Operation completed successfully",
id: 1,
duration: 5,
visible: true
}
];@gradio/statustracker is built around several key components:
Comprehensive status display component with progress indicators, queue information, ETA estimates, and timer functionality. Ideal for monitoring task progress in ML inference and asynchronous operations.
export interface StatusTrackerProps {
i18n: I18nFormatter;
eta?: number | null; // default: null
queue_position?: number | null;
queue_size?: number | null;
status?: "complete" | "pending" | "error" | "generating" | "streaming" | null;
scroll_to_output?: boolean; // default: false
timer?: boolean; // default: true
show_progress?: "full" | "minimal" | "hidden"; // default: "full"
message?: string | null; // default: null
progress?: LoadingStatus["progress"] | null | undefined; // default: null
variant?: "default" | "center"; // default: "default"
loading_text?: string; // default: "Loading..."
absolute?: boolean; // default: true
translucent?: boolean; // default: false
border?: boolean; // default: false
autoscroll?: boolean;
}Toast notification system for displaying success, error, warning, and info messages with auto-dismiss functionality and smooth animations.
export interface ToastProps {
messages: ToastMessage[];
}
export interface ToastContentProps {
title?: string;
message?: string;
type: "error" | "warning" | "info" | "success";
id: number;
duration?: number | null;
visible?: boolean;
}
export interface ToastMessage {
type: "error" | "warning" | "info" | "success";
title: string;
message: string;
id: number;
duration: number | null;
visible: boolean;
}Animated loading indicators and progress bars for various loading states and streaming operations.
export interface LoaderProps {
margin?: boolean; // default: true
}
export interface StreamingBarProps {
time_limit?: number | null;
}export interface LoadingStatus {
eta: number;
queue_position: number;
queue_size: number;
status: "pending" | "error" | "complete" | "generating" | "streaming";
show_progress: "full" | "minimal" | "hidden";
scroll_to_output: boolean;
visible: boolean;
fn_index: number;
message?: string;
progress?: {
progress: number | null;
index: number | null;
length: number | null;
unit: string | null;
desc: string | null;
}[];
time_limit?: number | null;
}
export interface ToastMessage {
type: "error" | "warning" | "info" | "success";
title: string;
message: string;
id: number;
duration: number | null;
visible: boolean;
}
export type I18nFormatter = (key: string, params?: Record<string, any>) => string;