21st.dev 원본
Spinner · Kibo
섹션 · MIT
갤러리 안에서는 화면을 벗어나거나 움직임을 멈추면 예제도 닫힙니다. 다시 재생할 때는 처음부터 시작해요.
저장한 HTML에서는 갤러리의 재생 설정이 적용되지 않아요.
SOURCE FILES
원본 코드 읽기
수집한 원본 소스와 실행 안내를 함께 제공합니다. 실행 HTML에는 미리보기를 위한 실행 환경이 들어 있습니다.
packages/spinner/index.tsx
import { Spinner as ShadcnSpinner } from "@repo/shadcn-ui/components/ui/spinner";
import {
LoaderCircleIcon,
LoaderIcon,
LoaderPinwheelIcon,
type LucideProps,
} from "lucide-react";
import { cn } from "@/lib/utils";
type SpinnerVariantProps = Omit<SpinnerProps, "variant">;
const Throbber = ({ className, ...props }: SpinnerVariantProps) => (
<LoaderIcon className={cn("animate-spin", className)} {...props} />
);
const Pinwheel = ({ className, ...props }: SpinnerVariantProps) => (
<LoaderPinwheelIcon className={cn("animate-spin", className)} {...props} />
);
const CircleFilled = ({
className,
size = 24,
...props
}: SpinnerVariantProps) => (
<div className="relative" style={{ width: size, height: size }}>
<div className="absolute inset-0 rotate-180">
<LoaderCircleIcon
className={cn("animate-spin", className, "text-foreground opacity-20")}
size={size}
{...props}
/>
</div>
<LoaderCircleIcon
className={cn("relative animate-spin", className)}
size={size}
{...props}
/>
</div>
);
const Ellipsis = ({ size = 24, ...props }: SpinnerVariantProps) => {
return (
<svg
height={size}
viewBox="0 0 24 24"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<title>Loading...</title>
<circle cx="4" cy="12" fill="currentColor" r="2">
<animate
attributeName="cy"
begin="0;ellipsis3.end+0.25s"
calcMode="spline"
dur="0.6s"
id="ellipsis1"
keySplines=".33,.66,.66,1;.33,0,.66,.33"
values="12;6;12"
/>
</circle>
<circle cx="12" cy="12" fill="currentColor" r="2">
<animate
attributeName="cy"
begin="ellipsis1.begin+0.1s"
calcMode="spline"
dur="0.6s"
keySplines=".33,.66,.66,1;.33,0,.66,.33"
values="12;6;12"
/>
</circle>
<circle cx="20" cy="12" fill="currentColor" r="2">
<animate
attributeName="cy"
begin="ellipsis1.begin+0.2s"
calcMode="spline"
dur="0.6s"
id="ellipsis3"
keySplines=".33,.66,.66,1;.33,0,.66,.33"
values="12;6;12"
/>
</circle>
</svg>
);
};
const Ring = ({ size = 24, ...props }: SpinnerVariantProps) => (
<svg
height={size}
stroke="currentColor"
viewBox="0 0 44 44"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<title>Loading...</title>
<g fill="none" fillRule="evenodd" strokeWidth="2">
<circle cx="22" cy="22" r="1">
<animate
attributeName="r"
begin="0s"
calcMode="spline"
dur="1.8s"
keySplines="0.165, 0.84, 0.44, 1"
keyTimes="0; 1"
repeatCount="indefinite"
values="1; 20"
/>
<animate
attributeName="stroke-opacity"
begin="0s"
calcMode="spline"
dur="1.8s"
keySplines="0.3, 0.61, 0.355, 1"
keyTimes="0; 1"
repeatCount="indefinite"
values="1; 0"
/>
</circle>
<circle cx="22" cy="22" r="1">
<animate
attributeName="r"
begin="-0.9s"
calcMode="spline"
dur="1.8s"
keySplines="0.165, 0.84, 0.44, 1"
keyTimes="0; 1"
repeatCount="indefinite"
values="1; 20"
/>
<animate
attributeName="stroke-opacity"
begin="-0.9s"
calcMode="spline"
dur="1.8s"
keySplines="0.3, 0.61, 0.355, 1"
keyTimes="0; 1"
repeatCount="indefinite"
values="1; 0"
/>
</circle>
</g>
</svg>
);
const Bars = ({ size = 24, ...props }: SpinnerVariantProps) => (
<svg
height={size}
viewBox="0 0 24 24"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<title>Loading...</title>
<style>{`
.spinner-bar {
animation: spinner-bars-animation .8s linear infinite;
animation-delay: -.8s;
}
.spinner-bars-2 {
animation-delay: -.65s;
}
.spinner-bars-3 {
animation-delay: -0.5s;
}
@keyframes spinner-bars-animation {
0% {
y: 1px;
height: 22px;
}
93.75% {
y: 5px;
height: 14px;
opacity: 0.2;
}
}
`}</style>
<rect
className="spinner-bar"
fill="currentColor"
height="22"
width="6"
x="1"
y="1"
/>
<rect
className="spinner-bar spinner-bars-2"
fill="currentColor"
height="22"
width="6"
x="9"
y="1"
/>
<rect
className="spinner-bar spinner-bars-3"
fill="currentColor"
height="22"
width="6"
x="17"
y="1"
/>
</svg>
);
const Infinite = ({ size = 24, ...props }: SpinnerVariantProps) => (
<svg
height={size}
preserveAspectRatio="xMidYMid"
viewBox="0 0 100 100"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<title>Loading...</title>
<path
d="M24.3 30C11.4 30 5 43.3 5 50s6.4 20 19.3 20c19.3 0 32.1-40 51.4-40 C88.6 30 95 43.3 95 50s-6.4 20-19.3 20C56.4 70 43.6 30 24.3 30z"
fill="none"
stroke="currentColor"
strokeDasharray="205.271142578125 51.317785644531256"
strokeLinecap="round"
strokeWidth="10"
style={{
transform: "scale(0.8)",
transformOrigin: "50px 50px",
}}
>
<animate
attributeName="stroke-dashoffset"
dur="2s"
keyTimes="0;1"
repeatCount="indefinite"
values="0;256.58892822265625"
/>
</path>
</svg>
);
export type SpinnerProps = LucideProps & {
variant?:
| "default"
| "throbber"
| "pinwheel"
| "circle-filled"
| "ellipsis"
| "ring"
| "bars"
| "infinite";
};
export const Spinner = ({ variant, ...props }: SpinnerProps) => {
switch (variant) {
case "throbber":
return <Throbber {...props} />;
case "pinwheel":
return <Pinwheel {...props} />;
case "circle-filled":
return <CircleFilled {...props} />;
case "ellipsis":
return <Ellipsis {...props} />;
case "ring":
return <Ring {...props} />;
case "bars":
return <Bars {...props} />;
case "infinite":
return <Infinite {...props} />;
default:
return (
<ShadcnSpinner className={cn("size-6", props.className)} {...props} />
);
}
};
packages/shadcn-ui/components/ui/spinner.tsx
import { Loader2Icon } from "lucide-react"
import { cn } from "@repo/shadcn-ui/lib/utils"
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
return (
<Loader2Icon
role="status"
aria-label="Loading"
className={cn("size-4 animate-spin", className)}
{...props}
/>
)
}
export { Spinner }
함께 쓰는 파일 9개 보기
packages/shadcn-ui/lib/utils.ts
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
packages/spinner/package.json
{
"name": "@repo/spinner",
"description": "A spinner is a visual indicator that shows progress or activity.",
"version": "0.0.0",
"private": true,
"dependencies": {
"@repo/shadcn-ui": "workspace:*",
"lucide-react": "^0.545.0",
"react": "^19.2.0",
"react-dom": "^19.2.0"
},
"devDependencies": {
"@repo/typescript-config": "workspace:*",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"typescript": "^5.9.3"
}
}
LICENSE
Copyright (c) 2023 — Present shadcnblocks
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Usage.tsx실행 안내·자료
// Local sampler for the pinned current Kibo Spinner implementation.
// The historical 21st demo's circle variant is now throbber; default is ShadcnSpinner.
import { Spinner, type SpinnerProps } from './packages/spinner/index';
const variants: NonNullable<SpinnerProps['variant']>[] = ['default', 'throbber', 'pinwheel', 'circle-filled', 'ellipsis', 'ring', 'bars', 'infinite'];
export default function Demo() {
return <div className="spinner-sampler">
{variants.map((variant) => <div className="spinner-sample" key={variant}>
<Spinner variant={variant} />
<span className="spinner-label">{variant}</span>
</div>)}
</div>;
}
runtime/mount.tsx실행 안내·자료
/** Local sandbox host. Ready is a mount observation, never a verification result. */
import React, { Component, useEffect } from 'react';
import { createRoot } from 'react-dom/client';
declare global {
interface Window {
__STYLEGALLERY_PREVIEW__: { id: string; status: string; errors: string[] };
}
}
export function mount(Demo: React.ComponentType, id: string) {
const state = window.__STYLEGALLERY_PREVIEW__ = { id, status: 'loading', errors: [] as string[] };
const send = (message: object) => parent.postMessage({ ...message, id }, '*');
const report = (error: unknown) => {
const message = error instanceof Error ? error.message : String(error);
if (!state.errors.includes(message)) state.errors.push(message);
state.status = 'error';
document.body.dataset.previewStatus = 'error';
send({ type: 'sg-preview-error', message });
};
window.addEventListener('error', (event) => report(event.error ?? event.message));
window.addEventListener('unhandledrejection', (event) => report(event.reason));
window.addEventListener('securitypolicyviolation', (event) => report(`Blocked by preview policy: ${event.violatedDirective}`));
const theme = new URLSearchParams(location.search).get('theme') === 'dark' ? 'dark' : 'light';
document.documentElement.classList.toggle('dark', theme === 'dark');
document.documentElement.dataset.theme = theme;
const observe = () => {
const root = document.getElementById('root')!;
const elements = Array.from(root.querySelectorAll('*'));
const rect = root.getBoundingClientRect();
const diagnostics = {
textLength: (root.textContent ?? '').trim().length,
elementCount: elements.length,
visibleElementCount: elements.filter((element) => {
const bounds = element.getBoundingClientRect();
const style = getComputedStyle(element);
return bounds.width > 0 && bounds.height > 0 && style.display !== 'none' && style.visibility !== 'hidden' && Number(style.opacity) !== 0;
}).length,
images: [],
canvases: [],
rootRect: { width: rect.width, height: rect.height },
documentWidth: document.documentElement.scrollWidth,
viewportWidth: innerWidth,
};
send({ type: 'sg-preview-observation', diagnostics });
};
class Boundary extends Component<{ children: React.ReactNode }, { error: string | null }> {
state = { error: null as string | null };
static getDerivedStateFromError(error: Error) { return { error: error.message }; }
componentDidCatch(error: Error) { report(error); }
render() { return this.state.error ? <p role="alert">This preview could not render: {this.state.error}</p> : this.props.children; }
}
function Ready() {
useEffect(() => {
const preference = matchMedia('(prefers-reduced-motion: reduce)');
const syncSVG = () => document.querySelectorAll('svg').forEach((svg) => {
if (preference.matches) svg.pauseAnimations?.();
else svg.unpauseAnimations?.();
});
syncSVG();
preference.addEventListener('change', syncSVG);
let second = 0;
let delayed = 0;
const first = requestAnimationFrame(() => { second = requestAnimationFrame(() => {
if (state.status !== 'error') {
state.status = 'mounted';
document.body.dataset.previewStatus = 'mounted';
send({ type: 'sg-preview-ready' });
observe();
delayed = window.setTimeout(observe, 700);
}
}); });
return () => {
cancelAnimationFrame(first);
cancelAnimationFrame(second);
clearTimeout(delayed);
preference.removeEventListener('change', syncSVG);
};
}, []);
return <Demo />;
}
createRoot(document.getElementById('root')!).render(<Boundary><Ready /></Boundary>);
}
runtime/styles.css실행 안내·자료
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@theme inline {
--color-foreground: var(--foreground);
}
:root {
--foreground: #172033;
background: #f8fafc;
color: var(--foreground);
color-scheme: light;
font-family: Arial, sans-serif;
}
:root.dark {
--foreground: #e2e8f0;
background: #0f172a;
color-scheme: dark;
}
body {
margin: 0;
min-height: 100vh;
}
#root {
min-height: 100vh;
}
#root[data-kind="spinner"] {
align-items: center;
box-sizing: border-box;
display: flex;
justify-content: center;
padding: 24px;
}
.spinner-sampler {
display: grid;
gap: 36px 24px;
grid-template-columns: repeat(2, minmax(0, 1fr));
max-width: 600px;
width: 100%;
}
.spinner-sample {
align-items: center;
display: flex;
flex-direction: column;
gap: 16px;
justify-content: center;
min-width: 0;
}
.spinner-label {
font-family: ui-monospace, monospace;
font-size: 11px;
overflow-wrap: anywhere;
text-align: center;
}
noscript {
display: block;
padding: 24px;
}
@media (min-width: 480px) {
.spinner-sampler {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-play-state: paused !important;
}
}
THIRD-PARTY-LICENSES.txt실행 안내·자료
clsx 2.1.1 — license
MIT License
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
========================================================================
lucide-react 0.544.0 — LICENSE
ISC License
Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---
The MIT License (MIT) (for portions derived from Feather)
Copyright (c) 2013-2023 Cole Bemis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
react 19.1.1 — LICENSE
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
react-dom 19.1.1 — LICENSE
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
scheduler 0.26.0 — LICENSE
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
tailwind-merge 3.3.1 — LICENSE.md
MIT License
Copyright (c) 2021 Dany Castillo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
provenance.json실행 안내·자료
{
"id": "21st-b8d654578921",
"sourceRevision": "3d63cdb15b79d972e3dc38a10997987672f9b263",
"license": "MIT",
"files": [
{
"file": "packages/spinner/index.tsx",
"sha256": "e46e2a2cd9dbdfef28d31b5321b770e022b8cd68ed331a290387bf8a861c411f",
"kind": "implementation",
"sourcePath": "packages/spinner/index.tsx"
},
{
"file": "packages/shadcn-ui/components/ui/spinner.tsx",
"sha256": "acf4f2aeb7fc29bd8aa22a6501b85dd4462d196e831dc5424be93ffdb49e21b4",
"kind": "implementation-dependency",
"sourcePath": "packages/shadcn-ui/components/ui/spinner.tsx"
},
{
"file": "packages/shadcn-ui/lib/utils.ts",
"sha256": "7c8c3dfc0cdd370d44932828eb067ef771c8fe7996693221d5d4b90af6d54f2d",
"kind": "implementation-dependency",
"sourcePath": "packages/shadcn-ui/lib/utils.ts"
},
{
"file": "packages/spinner/package.json",
"sha256": "39b5fb109d450cb6ca20566a3b548fd75d7f13e64b33a0a8e27076f9c78b4394",
"kind": "dependency-manifest",
"sourcePath": "packages/spinner/package.json"
},
{
"file": "LICENSE",
"sha256": "1fe9198b595ddadef7e2d99e3e1698c036db61c81e91c7b42df90d59f563b2ba",
"kind": "license",
"sourcePath": "license.md"
}
],
"adaptations": [
"The eight-variant sampler uses the current upstream variant name throbber in place of the historical 21st demo name circle. Current default delegates to ShadcnSpinner.",
"The local sampler adds labels and a responsive two/four-column host layout. Original Spinner modules remain byte-identical.",
"The host stops CSS and SVG animation when reduced motion is requested; original source modules do not implement this preference."
],
"runtimeDependencies": {
"clsx": "2.1.1",
"lucide-react": "0.544.0",
"react": "19.1.1",
"react-dom": "19.1.1",
"scheduler": "0.26.0",
"tailwind-merge": "3.3.1"
},
"runtime_verified": false
}
README.md실행 안내·자료
# Spinner · Kibo
Original implementation revision: `3d63cdb15b79d972e3dc38a10997987672f9b263`. Preserve the included MIT LICENSE. Original modules are byte-identical to their acquired sources. Usage.tsx and runtime/* are local integration support.
- The eight-variant sampler uses the current upstream variant name throbber in place of the historical 21st demo name circle. Current default delegates to ShadcnSpinner.
- The local sampler adds labels and a responsive two/four-column host layout. Original Spinner modules remain byte-identical.
- The host stops CSS and SVG animation when reduced motion is requested; original source modules do not implement this preference.
The standalone HTML includes all runtime JavaScript, CSS, and dependency notices. Open it directly to view the example; add ?theme=dark or ?theme=light to select the host theme. The two radial backgrounds keep their original fixed colors in either host theme. No external requests, storage, cookies, navigation, or provider app is needed.
To integrate source, use React 19, Tailwind CSS 4, and the included Usage.tsx. Kibo Spinner also needs lucide-react, clsx, and tailwind-merge; resolve @repo/shadcn-ui/ to packages/shadcn-ui/ and @/lib/utils to packages/shadcn-ui/lib/utils.ts. The supplied runtime styles define foreground tokens and the demo layout. Runtime dependency versions are recorded in provenance.json and their notices in THIRD-PARTY-LICENSES.txt.
The pinned upstream package manifest requests React/React DOM ^19.2.0 and lucide-react ^0.545.0. This gallery bundle uses the installed React/React DOM 19.1.1 and lucide-react 0.544.0. Compilation succeeded, but runtime compatibility has not been verified. For source integration, follow the original manifest; it is included unchanged.
The ready bridge signals a React mount, not verified behavior. Compilation and source integrity have been checked; browser behavior and accessibility remain unverified here.
BEHIND THE EXAMPLE
이 장면을 만드는 원리
로딩 모양과 처리 사실의 분리
불확정 진행 표시는 실제 작업의 상태를 설명해야 하며 완료율이나 성공을 만들어 내지 않습니다.
- 이 예제에서는
- 이 예제는 회전·점·링·막대·무한 곡선 등 8개 변형을 동시에 보여 줍니다. 네트워크 요청이나 진행률·완료 상태는 없습니다. 현재 고정 원본의 throbber는 과거 21st 데모의 circle 이름을 대체하고, default는 ShadcnSpinner를 호출합니다.
CSS와 SVG 재생을 함께 다루기
시스템 선호가 바뀔 때 효과를 다루되 같은 정보와 작업을 유지해야 합니다.
- 이 예제에서는
- 회전 변형과 bars는 CSS 애니메이션을 쓰고 ellipsis·ring·infinite는 SVG animate를 사용합니다. 원본에는 움직임 감소 경로가 없습니다. 이 미리보기의 호스트는 CSS 재생을 멈추고 SVG pauseAnimations를 함께 호출하며, 변형 이름은 그대로 남깁니다.
코드와 함께 확인하기
코드에서 찾기
attributeName="stroke-dashoffset"index.tsxInfinite는 CSS 애니메이션과 다른 SVG 시간 경로를 사용합니다.
const syncSVGmount.tsx감소 선호 변경을 감지해 SVG 시간을 정지·재개합니다.
animation-play-state: pausedstyles.css호스트의 CSS 효과 정지 규칙입니다.
직접 해보기
재생 도중 시스템의 움직임 감소를 켠 뒤 다시 끕니다.
살펴볼 변화CSS와 SVG 효과가 모두 선호를 따르는지 확인하고 변형 이름이 유지되는지 살펴봅니다. 호스트 구현 여부와 브라우저 실행 검증은 별개입니다.
실행 중인 미리보기를 화면 밖으로 이동했다 다시 실행합니다.
살펴볼 변화갤러리의 프레임 제거·재생 정책과 호스트 선호 처리가 함께 작동하는지 확인해야 합니다.
변형마다 다른 상태 의미
겉모습이 같아도 접근 가능한 이름과 상태 알림의 책임을 명시해야 합니다.
- 이 예제에서는
- default가 사용하는 ShadcnSpinner에는 role=status와 aria-label=Loading이 있습니다. 다른 변형은 Lucide 아이콘 또는 title이 있는 SVG로 구성되어 같은 의미가 자동으로 보장되지는 않습니다. 실제 제품에서는 어느 영역이 대기 문구와 상태 알림을 소유하는지 정해야 합니다.
코드와 함께 확인하기
코드에서 찾기
role="status"spinner.tsxdefault의 기본 상태 의미를 선언하고 전달된 props도 받습니다.
const Ellipsisindex.tsx점 변형은 SVG title과 애니메이션으로 구성됩니다.
직접 해보기
한 변형을 실제 대기 문구와 함께 배치해 접근성 트리와 화면 낭독을 확인합니다.
살펴볼 변화어떤 작업을 기다리는지 한 번 명확하게 전달해야 합니다. 모든 변형이 동일한 상태 메시지를 읽는다고 가정하지 않습니다.
