@reecem/svelte-slicezone
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Svelte Slicezone

This is a slice zone component for Prismic.

The current component makes the current assumptions:

There is a document that is passed that has a slices key:

{
	// other keys
	slices: []
}

To use the SliceZone and resolver.

<script>
	import { SliceZone, SliceResolver, getPageProps } from '@reecem/svelte-slicezone';

	// Load the index listing of slices.
	import * as Slices from '$lib/slices';
	// this is the list of slices to provide.
	// you can add others from other libs
	const allSlices = { ...Slices, /** ...anotherList */ };


	export const document = await getPageProps({
		client: Client(),
		type: 'homepage',
	});

</script>

<!-- This is the slicezone. The resolver can be overridden, but not really needed. -->
<SliceZone
	{...document}
	{allSlices}
	resolver={SliceResolver}
/>

Readme

Keywords

Package Sidebar

Install

npm i @reecem/svelte-slicezone

Weekly Downloads

3

Version

0.1.0

License

ISC

Unpacked Size

7.85 kB

Total Files

11

Last publish

Collaborators

  • reecem