Getting started
Install the package, import the components you need, and you are done — the styles ship with the library.
Installation
1pnpm add @dowardev/herdrate-vueOr with npm:
1npm install @dowardev/herdrate-vueVue is a peer dependency: the library requires vue ^3.4 and does not bundle it, so make sure your project already has Vue 3.4 or newer installed.
prettier ^3 is a second, optional peer dependency, and it is only needed if you format code yourself: the library loads Prettier only when you pass a formatter built with usePrettierFormatter() to <CodeBlock>. Install prettier yourself (plus the plugins for the languages you use — they are never installed for you) if that is your plan.
Import
Every component is exported from the package root:
1import { Button, Panel } from '@dowardev/herdrate-vue';Composables and types come from the same entry point:
1import { useDesign, useToast, DEFAULT_COLOR } from '@dowardev/herdrate-vue';2import type { Color, Fill, DesignLine } from '@dowardev/herdrate-vue';The package exposes a single root export (.). There are no per-component subpaths, so @dowardev/herdrate-vue/button does not exist — always import from @dowardev/herdrate-vue.
The package is ESM-only: it ships an import condition and no require condition, so require() from CommonJS does not resolve. Use an ESM build, or a dynamic import() from CommonJS.
Styles
The CSS is injected automatically as soon as any component is imported. There is no stylesheet to import and no CSS file to configure: importing a component is enough.
Usage
1<script setup lang="ts">2import { Button, Panel } from '@dowardev/herdrate-vue';3</script>45<template>6 <Panel divider>7 <template #header>Panel demo</template>8 <Button color="primary" @click="handleClick">Click me</Button>9 <template #footer>Panel footer</template>10 </Panel>11</template>Live example
The same markup, rendered by this site:
Next steps
- Browse the components and their props, slots and events.
- Learn the color system and the semantic tokens behind the
colorprop. - Customize the look with theming.
- Compare the available design lines.