@quartzds/core-vue
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.1 • Public • Published

@quartzds/core-vue

NPM Package License

Vue wrapper for Quartz design system web components.

💿 Installation

npm install @quartzds/core-vue vue

📖 Usage

Importing Components

Every Quartz core component is available to import as a Vue component. Note that we're importing the <QdsButton> Vue component instead of the <qds-button> custom element in the example below:

<template>
  <QdsButton importance="emphasized" text="Click me"></QdsButton>
</template>

<script setup>
import { QdsButton } from '@quartzds/core-vue'
</script>

Event Handling

Many Quartz core components emit custom events. For example, the input component emits the qdsInput event when it receives input. In Vue, you can listen to the event using @qdsInput.

Here's how you can bind the input's value to a state variable:

<template>
  <QdsInput
    value="{value}"
    @qdsInput="
      (event) => {
        value = event.target.value
      }
    "
  />
</template>

<script setup>
import { ref } from 'vue'
import { QdsInput } from '@quartzds/core-vue'

const value = ref('')
</script>

⚖️ License

See the LICENSE file for license rights and limitations.

/@quartzds/core-vue/

    Package Sidebar

    Install

    npm i @quartzds/core-vue

    Weekly Downloads

    131

    Version

    1.0.0-beta.1

    License

    LGPL-2.1-only

    Unpacked Size

    29 kB

    Total Files

    15

    Last publish

    Collaborators

    • quartzds-bot
    • quartzfm