Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

893 B
Raw Blame
/* Copyright 2026 Marimo. All rights reserved. */

import { cva, type VariantProps } from "class-variance-authority";
import { Loader2Icon } from "lucide-react";
import React from "react";
import { cn } from "@/utils/cn";

const spinnerVariants = cva("animate-spin", {
  variants: {
    centered: {
      true: "m-auto",
    },
    size: {
      small: "size-4",
      medium: "size-12",
      large: "size-20",
      xlarge: "size-20",
    },
  },
  defaultVariants: {
    size: "medium",
  },
});

const Spinner = React.forwardRef<
  SVGSVGElement,
  React.SVGProps<SVGSVGElement> & VariantProps<typeof spinnerVariants>
>(({ className, children: _children, centered, size, ...props }, ref) => (
  <Loader2Icon
    ref={ref}
    className={cn(spinnerVariants({ centered, size }), className)}
    strokeWidth={1.5}
    {...props}
  />
));
Spinner.displayName = "Spinner";

export { Spinner };