Coder Social home page Coder Social logo

alcidesqueiroz / tooltippy Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 533 KB

๐Ÿ’ฌ Graceful CSS-only tooltips in under 1kb gzipped.

License: MIT License

Shell 13.71% Stylus 86.29%
tooltips css css-only tiny under-1kb-gzipped multiple-themes hints elegant fancy modern ui graceful

tooltippy's Introduction

tooltippy Build status

๐Ÿ’ฌ Graceful CSS-only tooltips in under 1kb gzipped.

Tooltippy is sexy!

Install

With npm:

$ npm install tooltippy

With Yarn:

$ yarn add tooltippy

Usage

  1. Pick one of the available themes (you can see animated previews below);
  2. Import your theme's stylesheet (from inside the /dist folder). Naturally, the recommended format for production is the minified one, but expanded and debug versions are available for each theme too;
  3. In your target element, set the value of the data-tooltippy attribute to the text you want to show;
  4. Add the .tooltippy class to your target element;
  5. Define the position of your tooltip by using one of the existing direction classes (.tooltippy--top, .tooltippy--left, .tooltippy--bottom and .tooltippy--right);
  6. Optional step: If you want, you can import the suggested font-face for the theme you have chosen. All theme stylesheets have font-stacks with similar web-safe font-families as fallback.
<div class="tooltippy tooltippy--top" data-tooltippy="Hodor... Hodor?? Hodor!">
  <img src="hodor.jpg" />
</div>
  • IMPORTANT NOTICE 1: In order to behave correctly, the tooltip target element MUST have its position set to relative, absolute or fixed.
  • IMPORTANT NOTICE 2: Replaced elements (like img or input) can't be used as target.

Themes

Hipster

Hipster theme

Biz

Biz theme

Translucid

Translucid theme

High contrast

High contrast theme

Author

Alcides Queiroz Aguiar

License

This code is free to use under the terms of the MIT License.

tooltippy's People

Contributors

alcidesqueiroz avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.