All Projects → ghosh → Microtip

ghosh / Microtip

Licence: mit
💬 Minimal, accessible, ultra lightweight css tooltip library. Just 1kb.

Projects that are alternatives of or similar to Microtip

Flutter showcaseview
Flutter plugin that allows you to showcase your features on iOS and Android. 👌🔝🎉
Stars: ✭ 502 (-54.73%)
Mutual labels:  tooltip
React Useportal
🌀 React hook for Portals
Stars: ✭ 698 (-37.06%)
Mutual labels:  tooltip
Ng Bootstrap
Angular powered Bootstrap
Stars: ✭ 7,872 (+609.83%)
Mutual labels:  tooltip
Balloon.css
Simple tooltips made of pure CSS
Stars: ✭ 4,851 (+337.42%)
Mutual labels:  tooltip
Simptip
A simple CSS tooltip made with Sass
Stars: ✭ 648 (-41.57%)
Mutual labels:  tooltip
Tip
Programmable tooltip that can be used with any Mac OS app
Stars: ✭ 798 (-28.04%)
Mutual labels:  tooltip
Vue Tippy
VueJS Tooltip powered by Tippy.js
Stars: ✭ 395 (-64.38%)
Mutual labels:  tooltip
Tippyjs React
React component for Tippy.js (official)
Stars: ✭ 1,081 (-2.52%)
Mutual labels:  tooltip
Wenk
😉 Lightweight pure CSS tooltip for the greater good
Stars: ✭ 694 (-37.42%)
Mutual labels:  tooltip
A11y tooltips
Accessible Tooltip Component
Stars: ✭ 35 (-96.84%)
Mutual labels:  tooltip
React Laag
Hooks to build things like tooltips, dropdown menu's and popovers in React
Stars: ✭ 568 (-48.78%)
Mutual labels:  tooltip
Android Simple Tooltip
A simple library based on PopupWindow to create Tooltips on Android. 💚
Stars: ✭ 622 (-43.91%)
Mutual labels:  tooltip
Html5tooltipsjs
Tooltips with smooth 3D animation
Stars: ✭ 892 (-19.57%)
Mutual labels:  tooltip
Jquery Popup Overlay
jQuery plugin for responsive and accessible modal windows and tooltips
Stars: ✭ 511 (-53.92%)
Mutual labels:  tooltip
Intrinsics Dude
Opensource Visual Studio extension for compiler instrinsics in C/C++
Stars: ✭ 44 (-96.03%)
Mutual labels:  tooltip
React Cool Portal
😎 🍒 React hook for Portals, which renders modals, dropdowns, tooltips etc. to <body> or else.
Stars: ✭ 458 (-58.7%)
Mutual labels:  tooltip
Tooltips
Simple to use library for android, enabling to add a tooltip near any view with ease
Stars: ✭ 723 (-34.81%)
Mutual labels:  tooltip
Hint.css
A CSS only tooltip library for your lovely websites.
Stars: ✭ 8,158 (+635.62%)
Mutual labels:  tooltip
Viewtooltip
A fluent tooltip for Android
Stars: ✭ 1,029 (-7.21%)
Mutual labels:  tooltip
Sveltejs Tippy
Tippy.js for Svelte
Stars: ✭ 26 (-97.66%)
Mutual labels:  tooltip

Made with love License Build Status

Modern, minimal css tooptip library with accessibility baked in. Just `1kb` minified and gzipped.


Microtip

 

Table of Contents

 

Installation

via npm

npm install microtip

via yarn

yarn add microtip

via CDN

https://unpkg.com/microtip/microtip.css

direct download

curl -o microtip https://github.com/ghosh/microtip/blob/master/microtip.css

 

Setup

in PostCSS

@import 'microtip';

in Webpack

import microtip from 'microtip/microtip.css'

in SCSS

@import 'microtip/microtip';

Make sure, node_modules is included in the includePaths setting. You can then directly import the library into your file.

 

Usage

Using the tooltip is incredibly simple. Simply add a aria-label and role="tooltip" attribute to the element on which you want the tooltip to appear. The tooltip message is the attribute value aria-label="your message". This along with a position modifier is all you need to get going. Example:-

<button aria-label="Hey tooltip!" data-microtip-position="top" role="tooltip">

Position Modifiers

You can change the direction of the tooltip by adding a data-microtip-position attribute. The accepted values of this attribute are:- top, top-left, top-right, bottom, bottom-left, bottom-right, left and right. Example:-

<button aria-label="Hey tooltip!" data-microtip-position="top-left" role="tooltip">

Size Modifiers

By default, the tooltip will takeup only the size it requires to show the text. You can specify sizes by adding a data-microtip-size attribute. The accepted values include small, medium, large and fit. Example:-

<button aria-label="This is a decently long text!" data-microtip-position="top-left" data-microtip-size="medium" role="tooltip">

Note - fit sets the width of the tooltip to be the same as the width on the element. It only works along with the top and bottom position modifiers.

 

Customization

Microtip uses css variables, which allows you to customize the behavior of the tooltip as per your needs.

Variable Description Default Value
--microtip-transition-duration Specifies the duration of the tootltip transition .18s
--microtip-transition-delay The delay on hover before showing the tooltip 0s
--microtip-transition-easing The easing applied while transitioning the tooltip ease-in-out
--microtip-font-size Sets the font size of the text in tooltip 13px
--microtip-font-weight The font weight of the text in tooltip normal
--microtip-text-transform Controls the casing of the text none

 

Example:-

:root {
 --microtip-transition-duration: 0.5s;
 --microtip-transition-delay: 1s;
 --microtip-transition-easing: ease-out;
 --microtip-font-size: 13px;
 --microtip-font-weight: bold;
 --microtip-text-transform: uppercase;
}

The above code will cause all the tooltips to transition over 0.5s while applying an easing of type ease-out after a delay of 1s. The text will be bold and uppercase and have a font size of 13px.

You could also customize the tooltip for individual instances by using a selector more specific than :root. Example:-

.tooltip {
 --microtip-transition-duration: 0.2s;
 --microtip-transition-delay: 0s;
 --microtip-transition-easing: ease-in-out;
}

The above code would only affect the tooltips shown on any element with the tooltip class.

For more on css variables see here

 

Related

  • Micromodal - Tiny javascript library for creating accessible modal dialogs

 

Credits

 

✌️

A little project by @i_ghosh

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].