o-tooltip

Component description

active

Demo

Basic demo

<div class="o-colors-page-background">
	<div class="demo-tooltip-container" id="box-tooltip">

		<button class="o-buttons o-buttons--big demo-tooltip-target" id="demo-tooltip-target">
			Share
		</button>

		<div data-o-component="o-tooltip" data-o-tooltip-position="above" data-o-tooltip-target="demo-tooltip-target" data-o-tooltip-show-on-construction="true">
			<div class="o-tooltip-content">
				supercalifragilisticexpialidocious
			</div>
		</div>
	</div>
</div>

Hover

Display on hover demo

<div class="o-colors-page-background">
	<div class="demo-tooltip-container" id="box-tooltip">

		<button class="o-buttons o-buttons--big demo-tooltip-target" id="demo-tooltip-target">
			Share
		</button>

		<div data-o-component="o-tooltip" data-o-tooltip-position="right" data-o-tooltip-target="demo-tooltip-target" data-o-tooltip-show-on-hover="true">
			<div class="o-tooltip-content">
				Share this article via email
			</div>
		</div>
	</div>
</div>

Click

Display on click demo

<div class="o-colors-page-background">
	<div class="demo-tooltip-container" id="box-tooltip">

		<button class="o-buttons o-buttons--big demo-tooltip-target" id="demo-tooltip-target">
			Share
		</button>

		<div data-o-component="o-tooltip" data-o-tooltip-position="right" data-o-tooltip-target="demo-tooltip-target" data-o-tooltip-show-on-click="true">
			<div class="o-tooltip-content">
				Share this article via email
			</div>
		</div>
	</div>
</div>

Toggle

Toggle on click demo

<div class="o-colors-page-background">
    <div class="demo-tooltip-container" id="box-tooltip">

        <button class="o-buttons o-buttons--big demo-tooltip-target" id="demo-tooltip-target">
            Share
        </button>

        <div data-o-component="o-tooltip" data-o-tooltip-position="right" data-o-tooltip-target="demo-tooltip-target" data-o-tooltip-toggle-on-click="true" data-o-tooltip-close-after="3" data-o-tooltip-show-on-construction="true">
            <div class="o-tooltip-content">
                Share this article via email
            </div>
        </div>
    </div>
</div>

Timeout

Show/Hide Tooltip after timeout demo

<div class="o-colors-page-background">
    <div class="demo-tooltip-container" id="box-tooltip">
        <p>This tooltip will close after 3 seconds</p>
        <button class="o-buttons o-buttons--big demo-tooltip-target" id="demo-tooltip-target">
            Share
        </button>

        <div data-o-component="o-tooltip" data-o-tooltip-position="right" data-o-tooltip-target="demo-tooltip-target" data-o-tooltip-show-on-construction="true" data-o-tooltip-close-after="3">
            <div class="o-tooltip-content">
                Share this article via email
            </div>
        </div>
        <p>This tooltip will show after 3 seconds</p>
        <button class="o-buttons o-buttons--big demo-tooltip-target" id="demo-tooltip-target-2">
            Share
        </button>

        <div data-o-component="o-tooltip" data-o-tooltip-position="right" data-o-tooltip-target="demo-tooltip-target-2" data-o-tooltip-show-after="3">
            <div class="o-tooltip-content">
                Share this article via email
            </div>
        </div>
    </div>
</div>

No-markup

Tooltip declared in js, with no markup

<div class="o-colors-page-background">
	<div class="demo-tooltip-container" id="box-tooltip">

		<button class="o-buttons o-buttons--big imperative-tooltip-target">
			Hover
		</button>
	</div>
</div>
Bower Dependencies
ftdomdelegate ^2.1.0
o-normalise ^1.2.1
o-overlay ^2.0.0
o-viewport ^3.1.2
o-visual-effects ^2.0.0
GitHub Repository

Quickstart

Build Service

Add the following to your <script> and <link> tags.

o-tooltip@^2.3.7

How do I do that?

For more information see the Origami build service.

Manual Build Process

Run the following command in the root directory of your project, to add this dependency to your bower.json file:

bower install --save "o-tooltip"@"^2.3.7"

For more information see the Origami build process.