API CIFPlayer
data: String
Show initial structuredata: string (data to visualize, sent to the viewer on load)
The CIFPlayer component allows you to embed the interactive crystal structure viewer directly into your Svelte application. This is useful for visualizing the crystal structure formats CIF, POSCAR, and Optimade in scientific and educational projects.
<CIFPlayer data={initialData} />
<script>
import { CIFPlayer } from 'svelte-spectre';
let initialData = `...`; // your crystal structure
</script>
Note: The viewer is loaded from an external website https://nanoshow.mpds.io. Ensure your users have internet access to use this feature.