This package has been deprecated

Author message:

No longer supported

@directus/vue-snippet-toggler

0.0.3 • Public • Published

vue-snippet-toggler

Screenshot of the Snippet Toggler component

We wanted to have a nice way to show various snippets of code inside of our docs, so we figured we'd open source that component as well!

Installation

npm install @directus/vue-snippet-toggler

Usage

<script setup>
import { ref } from 'vue';

import { SnippetToggler } from '@directus/vue-snippet-toggler';
import '@directus/vue-snippet-toggler/style.css';

const pref = ref('REST');
</script>

<template>
	<SnippetToggler
		v-model="pref"
		:choices="['REST', 'GraphQL']"
		label="API"
	>
		<template #rest>
			<!-- Your REST example -->
		</template>

		<template #graphql>
			<!-- Your REST example -->
		</template>
	</SnippetToggler>
</template>

Contributing

This component was made for internal use, so it may or may not be flexible (enough) for your project. Contributions are more than welcome! Make sure to open an issue first outlining the change you'd like to make.

Cutting Releases

To push a new version of the library, run pnpm version <minor | patch> to update the version number and create the tag, and push both changes to GitHub with git push and git push --tags.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @directus/vue-snippet-toggler

Weekly Downloads

7

Version

0.0.3

License

none

Unpacked Size

8.29 kB

Total Files

6

Last publish

Collaborators

  • benhaynes
  • rijk