All Projects → JFusco → vue-popover

JFusco / vue-popover

Licence: MIT License
Reusable popover component for Vue

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to vue-popover

vue-notification-bell
Vue.js notification bell component.
Stars: ✭ 64 (+190.91%)
Mutual labels:  vuejs2, vue-component
testing-angular-applications
Project for the Testing Angular Applications book
Stars: ✭ 99 (+350%)
Mutual labels:  jasmine, karma
toppy
Overlay library for Angular 7+
Stars: ✭ 81 (+268.18%)
Mutual labels:  popover, dropdown
Angularjs Webpack Starter
🚀 A modern frontend setup for AngularJS projects using NPM, TypeScript and Webpack.
Stars: ✭ 173 (+686.36%)
Mutual labels:  jasmine, karma
rollup-plugin-istanbul
Seamless integration between Rollup and Istanbul
Stars: ✭ 39 (+77.27%)
Mutual labels:  karma, istanbul
Feathers Vue
A boiler plate template using Feathers with Email Verification, Vue 2 with Server Side Rendering, stylus, scss, jade, babel, webpack, ES 6-8, login form, user authorization, and SEO
Stars: ✭ 195 (+786.36%)
Mutual labels:  jasmine, vuejs2
floating-ui
A low-level toolkit to create floating elements. Tooltips, popovers, dropdowns, and more
Stars: ✭ 23,485 (+106650%)
Mutual labels:  popover, dropdown
Semaphore Ng2 Webpack
Stars: ✭ 81 (+268.18%)
Mutual labels:  jasmine, karma
angular-unit-testing-examples
Showroom for different Angular unit testing concepts
Stars: ✭ 19 (-13.64%)
Mutual labels:  jasmine, karma
angular-material-boilerplate
A straightforward and well structured boilerplate based on Google's Angular Material project.
Stars: ✭ 28 (+27.27%)
Mutual labels:  jasmine, karma
Saka
Elegant tab, bookmark and history search
Stars: ✭ 170 (+672.73%)
Mutual labels:  jasmine, karma
vue-single-select
single select dropdown with autocomplete
Stars: ✭ 43 (+95.45%)
Mutual labels:  dropdown, vue-component
Karma
Spectacular Test Runner for JavaScript
Stars: ✭ 11,591 (+52586.36%)
Mutual labels:  jasmine, karma
React Cordova Boilerplate
TodoMVC example for react with development tools to build a cordova application
Stars: ✭ 206 (+836.36%)
Mutual labels:  jasmine, karma
Springbootangularhtml5
♨️ Spring Boot 2 + Angular 11 + HTML5 router mode + HTTP interceptor + Lazy loaded modules
Stars: ✭ 89 (+304.55%)
Mutual labels:  jasmine, karma
react-layer-stack
Layering system for React. Useful for popover/modals/tooltip/dnd application
Stars: ✭ 158 (+618.18%)
Mutual labels:  popover, dropdown
Egeo
EGEO is the open-source UI library used to build Stratio's UI. It includes UI Components, Utilities, Services and much more to build user interfaces quickly and with ease. The library is distributed in AoT mode.
Stars: ✭ 69 (+213.64%)
Mutual labels:  jasmine, karma
Karmatic
🦑 Easy automatic (headless) browser testing with Jest's API, but powered by Karma & Webpack.
Stars: ✭ 1,178 (+5254.55%)
Mutual labels:  jasmine, karma
generator-speedseed
Oriented to components, allow create/choice template, multiple configuration with easy maintenance
Stars: ✭ 13 (-40.91%)
Mutual labels:  jasmine, karma
metadatamanagement
Metadatamanagement (MDM) - Data Search for Higher Education Research and Science Studies
Stars: ✭ 21 (-4.55%)
Mutual labels:  jasmine, karma

vue-popover

Build Status

peerDependency Status devDependency Status

MIT npm

Reusable popover component for Vue. This is purely functional, it's a completely "naked" and blank canvas component. There are no styles for this component except a z-index, which you can override.

Demo

https://jfusco.github.io/vue-popover

Getting Started

Installation

From the root of your project.

npm install vue-popover --save

Usage

Simple implementation of popover. See options available below.

<template>
	<div>
		<popover name="example">
			<div slot="content">
				<ul>
					<li><a href="#">npmjs.com</a></li>
					<li><a href="#">github.com</a></li>
				</ul>
			</div>
		</popover>
	</div>
</template>

<script type="text/babel">
	import popover from 'popover'

	export default {
		components: {
			popover
		}
	}
</script>

Options

name ~ required

The string to be used for a unique ID for the component instance, also used to set aria attributes

<template>
	<div>
		<popover name="example"></popover>
	</div>
</template>

popover:open ~ optional

An function triggered any time the instance of the popover is opened

<template>
	<div>
		<popover name="example" v-on:popover:open="onPopoverOpen"></popover>
	</div>
</template>

<script type="text/babel">
	import popover from 'popover'

	export default {
		components: {
			popover
		},
		methods: {
			onPopoverOpen(){
				console.log('popover open')
			}
		}
	}
</script>

popover:close ~ optional

An function triggered any time the instance of the popover is closed

<template>
	<div>
		<popover name="example" v-on:popover:close="onPopoverClose"></popover>
	</div>
</template>

<script type="text/babel">
	import popover from 'popover'

	export default {
		components: {
			popover
		},
		methods: {
			onPopoverClose(){
				console.log('popover close')
			}
		}
	}
</script>

available slots
  • face - Set custom face for the popover
  • content - Set custom content for the popover
<template>
	<div>
		<popover name="example">
			<div slot="face">
				<button>popover face</button>
			</div>

			<div slot="content">
				<p>Some custom content for popover</p>
			</div>
		</popover>
	</div>
</template>

closeOnContentClick ~ optional

Set to false if you don't want the popover to close if you click its contents. Useful if the popover contains elements you interact with (e.g. buttons and textboxes). This defaults to true when not set.

<template>
	<div>
		<popover name="example" :closeOnContentClick="false">
			<div slot="face">
				<button>popover face</button>
			</div>

			<div slot="content">
				<button>Some button</button>
				<input type="text">
			</div>
		</popover>
	</div>
</template>

slim ~ optional

Defaults to false, if enabled, it means the "face" slot is required and the rendered component will be wrapper-less, there will be no further elements around the "face" slot. To do this the onPopoverToggle method is passed to the slot (with slim the slot becomes scoped).

Important: the content slot will render inside the root element of the face slot. As the content slot still has a wrapper and will appear absolutely positioned, the face slot will probably need to be positioned, relative will work well for most use cases.

<template>
	<div>
		<popover name="example" slim>
			<a
				slot="face"
				slot-scope="{ onPopoverToggle }"
				href="#"
				@click.prevent="onPopoverToggle">
				slim popover</a>
			<div slot="content">
				<p>Some custom content for popover</p>
			</div>
		</popover>
	</div>
</template>

Styling

Installation

Import the main SCSS file in to your application SCSS files ​```scss @import "node_modules/vue-popover/src/component/scss/styles.scss";


There are a few variables set to `!default` that can be overriden. If you need to change it more just override the actual styles.

**Any overriden variables needs to go above the `@import` statement to take effect**
​```scss
//-- Global UI
$popover-z-index

If you don't care to override variables and just want to override actual styles you may choose to import the minified compiled version of the css instead

@import "node_modules/vue-popover/dist/styles.css";

Tests

npm test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].