Override CSS variables to match your app's design system. Pass a flat object for a single theme, or use modes to provide separate light and dark values.
import { useExpressCSV, x, type ECSVTheme } from "@expresscsv/react";const theme: ECSVTheme = { primary: "#4F46E5", "primary-foreground": "#ffffff", background: "#ffffff", foreground: "#0f172a", border: "#e5e7eb", ring: "#A5B4FC", radius: "0.5rem",};const { open } = useExpressCSV({ schema, publishableKey: "pk_test_...", // Your ExpressCSV publishable key importIdentifier: "user-import", // Ties this config to a specific import flow theme, // Applies these design tokens to the widget});
const { open } = useExpressCSV({ schema, publishableKey: "pk_test_...", // Your ExpressCSV publishable key importIdentifier: "user-import", // Ties this config to a specific import flow colorMode: "system", // Match the user's OS or app color preference});
Every element in the widget is stylable. Open your browser inspector and look for ecsv-... class names on the element you want to target.
Class names shown before the 🔒 marker are public and safe to style. Everything after 🔒 is a private implementation detail and may change between versions.
Your customCSS is automatically scoped to the widget, so you can target public classes directly:
const { open } = useExpressCSV({ schema, publishableKey: "pk_test_...", // Your ExpressCSV publishable key importIdentifier: "user-import", // Ties this config to a specific import flow customCSS: ` .ecsv-step-upload { padding: 1.5rem; } .ecsv-card { border-radius: 1rem; } .ecsv-button { font-weight: 600; border-radius: 9999px; } `,});
Load fonts from Google Fonts or a custom URL, then reference them in your theme:
const { open } = useExpressCSV({ schema, publishableKey: "pk_test_...", // Your ExpressCSV publishable key importIdentifier: "user-import", // Ties this config to a specific import flow fonts: { title: { source: "google", name: "Space Grotesk", weights: [400, 600, 700] }, // Load the heading font from Google Fonts body: { source: "custom", url: "https://example.com/font.woff2", format: "woff2" }, // Load your body font from a hosted asset }, theme: { "font-title": "'Space Grotesk', sans-serif", // Use the loaded title font in the widget "font-body": "'Custom Font', sans-serif", // Use the loaded body font in the widget },});
const { open } = useExpressCSV({ schema, publishableKey: "pk_test_...", // Your ExpressCSV publishable key importIdentifier: "user-import", // Ties this config to a specific import flow stepDisplay: "segmented", // Show progress as labeled steps instead of a bar});