
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@hoppscotch/ui
Advanced tools
Welcome to hoppscotch-ui, a collection of presentational components for our web applications. This library is built using Vue 3 and Tailwind CSS. Preview the components in Histoire.
To install the library in your project, run the following command:
pnpm add @hoppscotch/ui
In your main.ts
file, import the library and register it as a plugin:
import { createApp } from "vue"
import App from "./App.vue"
// Import the library
import { plugin as HoppUI } from "@hoppscotch/ui"
// Import theme styles for default styling (optional)
import "@hoppscotch/ui/themes.css"
// Import the styles
import "@hoppscotch/ui/style.css"
const app = createApp(App)
// Register the library as a plugin
app.use(HoppUI)
app.mount("#app")
The Library uses Tailwind CSS under the hood, so you have to import the preset in your tailwind.config.ts
file:
import preset from "@hoppscotch/ui/ui-preset"
export default {
content: ["src/**/*.{vue,html}"],
presets: [preset],
}
You can use the components in your Vue templates like this:
<template>
<HoppButtonPrimary label="Click me" />
</template>
<script lang="ts" setup>
import { HoppButtonPrimary } from "@hoppscotch/ui"
</script>
If you're using unplugin-vue-components
in your project, you can import the components like this without having to import them in the script section:
<template>
<HoppButtonPrimary label="Click me" />
</template>
<script lang="ts" setup>
</script>
To configure resolve options for unplugin-vue-components
, add the following to your vite.config.ts
file:
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import Components from "unplugin-vue-components/vite"
export default defineConfig({
plugins: [
vue(),
Components({
resolvers: [
// auto import components
(name) => {
if (name.startsWith("Hopp")) {
return {
importName: name,
path: "@hoppscotch/ui",
}
}
},
],
}),
],
})
We've included Histoire in this library which is similar to Storybook, to make it easy to play with the components in the browser. You can run Histoire in the browser with command
pnpm run story:dev
You can also use Histoire to create stories for your components and test them in different scenarios.
This project follows Semantic Versioning but as the project is still pre-1.0. The code and the public exposed API should not be considered to be fixed and stable. Things can change at any time!
This project is licensed under the MIT License - see LICENSE
for more details.
FAQs
Hoppscotch UI
The npm package @hoppscotch/ui receives a total of 947 weekly downloads. As such, @hoppscotch/ui popularity was classified as not popular.
We found that @hoppscotch/ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.