### Installing vue3-popper Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Commands to install the vue3-popper library using either Yarn or NPM package managers. Requires a terminal in the project directory. ```bash $ yarn add vue3-popper ``` ```bash $ npm i vue3-popper ``` -------------------------------- ### Using Vue3Popper Content Prop Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Shows how to provide simple string content for the popover using the `content` prop directly on the `` component. The wrapped element acts as the trigger. ```vue ``` -------------------------------- ### Installing vue3-popper with NPM Source: https://github.com/valgeirb/vue3-popper/blob/main/README.md Installs the vue3-popper library using the npm package manager. This command adds the package as a project dependency. ```bash npm install vue3-popper ``` -------------------------------- ### Installing vue3-popper with Yarn Source: https://github.com/valgeirb/vue3-popper/blob/main/README.md Installs the vue3-popper library using the yarn package manager. This command adds the package as a project dependency. ```bash yarn add vue3-popper ``` -------------------------------- ### Use the Custom Popper Wrapper Component Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Shows an example of how to use the custom MyPopperWrapper component in a Vue template, passing props like arrow and placement, and providing content via the default slot (for the trigger) and the named #content slot (for the popper content). ```vue ``` -------------------------------- ### Importing Separate CSS Theme File Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Demonstrates how to import a separate CSS file containing theme variables into the main Vue application entry point to apply global styles, including those for the Popper component. ```javascript import { createApp } from "vue"; import App from "./App.vue"; import "./theme.css"; // Magic happens here createApp(App).mount("#app"); ``` -------------------------------- ### Using Vue3Popper Content Slot Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Illustrates how to use the `#content` slot to provide more complex HTML or Vue component content for the popover. The wrapped element is the trigger. ```vue ``` -------------------------------- ### Locally Importing Vue3Popper Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Demonstrates how to import and use the Popper component within a single Vue component by adding it to the `components` option. Allows using `` directly in the template. Requires Vue 3. ```html ``` ```javascript import { defineComponent } from "vue"; import Popper from "vue3-popper"; export default defineComponent({ components: { Popper, }, }); ``` -------------------------------- ### Globally Registering Vue3Popper Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Imports the Popper component and registers it globally with the Vue application instance, making it available in any component template without explicit import. Requires Vue 3. ```javascript import { createApp } from "vue"; import Popper from "vue3-popper"; const app = Vue.createApp({}); app.component("Popper", Popper); ``` -------------------------------- ### Create a Wrapper Component for Vue3 Popper Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Provides the template and script for creating a reusable Vue component (MyPopperWrapper) that wraps the vue3-popper component, demonstrating how to pass attributes ($attrs), hardcode specific props (like hover, openDelay, closeDelay), and forward slots. ```vue ``` -------------------------------- ### Styling Vue3Popper in Separate CSS File Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Shows how to define CSS variables to style the Popper component in a dedicated `.css` file, allowing for centralized theme management. These variables override default styles. ```css :root { --popper-theme-background-color: #333333; --popper-theme-background-color-hover: #333333; --popper-theme-text-color: #ffffff; --popper-theme-border-width: 0px; --popper-theme-border-style: solid; --popper-theme-border-radius: 6px; --popper-theme-padding: 32px; --popper-theme-box-shadow: 0 6px 30px -6px rgba(0, 0, 0, 0.25); } ``` -------------------------------- ### Handle Popper Open and Close Events in Vue Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Demonstrates how to listen for the built-in @open:popper and @close:popper events on the Popper component in a Vue template and trigger corresponding methods (openAlert, closeAlert) in the component's script to perform side effects. ```vue ``` -------------------------------- ### Define Dynamic Themes with CSS Variables Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Defines CSS variables within .dark and .light classes to provide distinct visual themes for the vue3-popper component, allowing easy switching between themes by changing a class on the component or a parent element. ```css .dark { --popper-theme-background-color: #333333; --popper-theme-background-color-hover: #333333; --popper-theme-text-color: white; --popper-theme-border-width: 0px; --popper-theme-border-radius: 6px; --popper-theme-padding: 32px; --popper-theme-box-shadow: 0 6px 30px -6px rgba(0, 0, 0, 0.25); } .light { --popper-theme-background-color: #ffffff; --popper-theme-background-color-hover: #ffffff; --popper-theme-text-color: #333333; --popper-theme-border-width: 1px; --popper-theme-border-style: solid; --popper-theme-border-color: #eeeeee; --popper-theme-border-radius: 6px; --popper-theme-padding: 32px; --popper-theme-box-shadow: 0 6px 30px -6px rgba(0, 0, 0, 0.25); } ``` -------------------------------- ### Manually Control Popper Visibility with show Prop Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Shows how to use the show prop to programmatically control the visibility of the Popper component, demonstrating binding it to a data property (showPopper) which is toggled by an external control like a checkbox input. ```vue ``` -------------------------------- ### Styling Vue3Popper with CSS Variables in Component Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Demonstrates overriding the default appearance of the Popper component by defining CSS variables within the ` ``` -------------------------------- ### Apply Dynamic Theme Class in Vue Template Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Demonstrates applying a dynamic CSS class (:class="theme") to the Popper component in a Vue template, enabling the use of the previously defined CSS variable themes based on a component data property or computed property. ```vue ``` -------------------------------- ### Apply Custom Styles Using Scoped CSS and :deep Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Shows how to apply custom styles directly to the Popper component and its internal elements (#arrow) within a scoped Vue style block using the :deep selector, providing an alternative to the CSS variable approach for styling. ```vue ``` -------------------------------- ### Access Scoped Slot Properties for Manual Control Source: https://github.com/valgeirb/vue3-popper/blob/main/docs/guide/getting-started.md Illustrates how to access scoped slot properties, specifically the close function, within the #content slot of the Popper component, enabling manual dismissal of the popper from within its content, such as clicking a button inside the popper. ```vue ``` -------------------------------- ### Using vue3-popper with content Prop (Vue) Source: https://github.com/valgeirb/vue3-popper/blob/main/README.md Demonstrates how to use the vue3-popper component in a Vue template by passing simple string content directly via the 'content' prop. ```html ``` -------------------------------- ### Using vue3-popper with content Slot (Vue) Source: https://github.com/valgeirb/vue3-popper/blob/main/README.md Shows how to use the vue3-popper component in a Vue template with more complex content provided through the dedicated 'content' slot. ```html ``` -------------------------------- ### Defining Vue Component with vue3-popper Source: https://github.com/valgeirb/vue3-popper/blob/main/README.md Imports the vue3-popper component and registers it within a standard Vue 3 component definition using defineComponent, making it available for use in the template. ```javascript ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.