Shared component library for HSRP apps using Vue and documented via VuePress.
View component demos and documentation here
# install dependencies
npm install
# start the VuePress instance for documentation, including live component demos
npm run docs:dev
# build the component library, bundled into dist directory
npm run build
# build the VuePress document site, bundled into docs/.vuepress/dist
npm run docs:build
The library is a Vue plugin. Its install
function in install.js imports all components from components
folder, registers them to Vue and automatically call itself. You can also import components individually, either in main.js and register globally, or within specific single-file components. This method may be preferred so that IDEs are able to recognize component metadata.
<template>
<Alert text="This is an alert message" />
<Button label="Click me" />
</template>
<script>
import { Alert, Button } from 'hsrp-components';
export default {
components: { Alert, Button },
}
</script>
The components within this library currently rely on uswds (U.S. Web Design System), and vue-select (for special text input/select functionality)
To ensure the smallest bundle size, import specific functions from dependencies.