https://github.com/user-attachments/assets/903f2483-6fac-4592-be09-5fdc17196a84
A parabolic spherical orbital loading component, inspired by quantum superposition of atomic orbitals and the wave function collapse concept. Particles occupy multiple quantum states until interacting (hovering), creating a mesmerizing, high-performance UI element.
Available for both React and Svelte 5.
npm install quantum-sphere-loading
# or
pnpm add quantum-sphere-loading
# or
yarn add quantum-sphere-loading
import React from 'react';
import QuantumWaveOrbital from 'quantum-sphere-loading';
import 'quantum-sphere-loading/css'; // Import styles
function App() {
return (
<div style={{ height: '500px', width: '100%' }}>
<QuantumWaveOrbital
autoRandomize={true}
onSphereClick={() => console.log('Sphere clicked')}
className="my-custom-class"
/>
</div>
);
}
<script>
import QuantumWaveOrbital from 'quantum-sphere-loading/svelte';
</script>
<div class="container">
<QuantumWaveOrbital
autoRandomize={true}
onSphereClick={() => console.log('Sphere clicked')}
/>
</div>
<style>
.container {
height: 500px;
width: 100%;
}
</style>
You can customize the sphere by passing a config prop/prop.
// Example custom config
const myConfig = {
minLines: 8,
maxLines: 16,
minSphereSize: 150,
maxSphereSize: 200,
minRotationSpeed: 5,
maxRotationSpeed: 20,
// ... see types for full list
};
<QuantumWaveOrbital config={myConfig} />
| Prop | Type | Default | Description |
|---|---|---|---|
config |
OrbitalSphereConfig |
(Default Preset) | detailed configuration object |
autoRandomize |
boolean |
true |
Periodically changes the sphere's configuration (colors, lines, size) |
className |
string |
"" |
Additional CSS classes for the container |
onSphereClick |
() => void |
null |
Callback when the sphere is clicked |
See src/QuantumSphere.d.ts (or your IDE's autocomplete) for the full list of configuration options, including:
minLines / maxLinesminSphereSize / maxSphereSizeminGlowIntensity / maxGlowIntensityminSaturation / maxSaturationautoRandomizeMin / autoRandomizeMax (ms)MIT © vtempest