{"id":13409425,"url":"https://github.com/ghosh/microtip","last_synced_at":"2025-05-15T00:09:03.704Z","repository":{"id":45994746,"uuid":"88668998","full_name":"ghosh/microtip","owner":"ghosh","description":"💬  Minimal, accessible, ultra lightweight css tooltip library. Just 1kb.","archived":false,"fork":false,"pushed_at":"2023-08-10T21:12:45.000Z","size":376,"stargazers_count":1390,"open_issues_count":28,"forks_count":73,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-13T21:34:02.885Z","etag":null,"topics":["1kb","accessibility","css","simple-api","tooltip"],"latest_commit_sha":null,"homepage":"https://microtip.vercel.app/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghosh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-18T20:45:23.000Z","updated_at":"2025-04-13T18:56:56.000Z","dependencies_parsed_at":"2023-02-14T00:55:30.333Z","dependency_job_id":"a46ff764-224d-4ebd-a5e3-238ff4662dfd","html_url":"https://github.com/ghosh/microtip","commit_stats":{"total_commits":52,"total_committers":6,"mean_commits":8.666666666666666,"dds":0.25,"last_synced_commit":"3a5288376d451e421666680983788cb0a519089d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosh%2Fmicrotip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosh%2Fmicrotip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosh%2Fmicrotip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghosh%2Fmicrotip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghosh","download_url":"https://codeload.github.com/ghosh/microtip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249205,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["1kb","accessibility","css","simple-api","tooltip"],"created_at":"2024-07-30T20:01:00.675Z","updated_at":"2025-05-15T00:08:58.690Z","avatar_url":"https://github.com/ghosh.png","language":"CSS","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://www.dropbox.com/s/lux7521vqphtrsz/microtip.png?raw=1\" width=\"200px\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/made%20with-love-E760A4.svg\" alt=\"Made with love\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-green.svg\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/ghosh/microtip\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://api.travis-ci.org/ghosh/microtip.svg\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nModern, minimal css tooptip library with accessibility baked in. Just `1kb` minified and gzipped.\n\u003c/p\u003e\n\n---\n\n![Microtip](https://www.dropbox.com/s/gracjkb2rca2zj6/microtip.gif?raw=1)\n\n\u0026nbsp;\n\n\n## Table of Contents\n- [Installation](#installation)\n- [Setup](#setup)\n- [Usage](#usage)\n- [Customization](#customization)\n- [Related](#related)\n\n\u0026nbsp;\n## Installation\n\n**via npm**\n```shell\nnpm install microtip\n```\n\n**via yarn**\n```shell\nyarn add microtip\n```\n\n**via CDN**\n```\nhttps://unpkg.com/microtip/microtip.css\n```\n\n**direct download**\n```shell\ncurl -o microtip https://github.com/ghosh/microtip/blob/master/microtip.css\n```\n\n\u0026nbsp;\n## Setup\n\n**in PostCSS**\n```scss\n@import 'microtip';\n```\n\n**in Webpack**\n```javascript\nimport microtip from 'microtip/microtip.css'\n```\n\n**in SCSS**\n```scss\n@import 'microtip/microtip';\n```\nMake sure, `node_modules` is included in the `includePaths` setting. You can then directly import the library into your file.\n\n\u0026nbsp;\n## Usage\n\nUsing 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:-\n```html\n\u003cbutton aria-label=\"Hey tooltip!\" data-microtip-position=\"top\" role=\"tooltip\"\u003e\n```\n\n### Position Modifiers\n\nYou 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:-\n```html\n\u003cbutton aria-label=\"Hey tooltip!\" data-microtip-position=\"top-left\" role=\"tooltip\"\u003e\n```\n\n### Size Modifiers\n\nBy 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:-\n```html\n\u003cbutton aria-label=\"This is a decently long text!\" data-microtip-position=\"top-left\" data-microtip-size=\"medium\" role=\"tooltip\"\u003e\n```\n\n**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.\n\n\u0026nbsp;\n## Customization\n\nMicrotip uses **css variables**, which allows you to customize the behavior of the tooltip as per your needs.\n\n\n| Variable                         | Description                                        | Default Value |\n|----------------------------------|----------------------------------------------------|---------------|\n| `--microtip-transition-duration` | Specifies the duration of the tootltip transition  | `.18s`        |\n| `--microtip-transition-delay`    | The delay on hover before showing the tooltip      | `0s`          |\n| `--microtip-transition-easing`   | The easing applied while transitioning the tooltip | `ease-in-out` |\n| `--microtip-font-size`           | Sets the font size of the text in tooltip          | `13px`        |\n| `--microtip-font-weight`         | The font weight of the text in tooltip             | `normal`      |\n| `--microtip-text-transform`      | Controls the casing of the text                    | `none`        |\n\n\u0026nbsp;\n\nExample:-\n```css\n:root {\n --microtip-transition-duration: 0.5s;\n --microtip-transition-delay: 1s;\n --microtip-transition-easing: ease-out;\n --microtip-font-size: 13px;\n --microtip-font-weight: bold;\n --microtip-text-transform: uppercase;\n}\n```\n\nThe 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`.\n\nYou could also customize the tooltip for individual instances by using a selector more specific than `:root`. Example:-\n\n```css\n.tooltip {\n --microtip-transition-duration: 0.2s;\n --microtip-transition-delay: 0s;\n --microtip-transition-easing: ease-in-out;\n}\n```\n\nThe above code would only affect the tooltips shown on any element with the `tooltip` class.\n\nFor more on css variables see [here](https://css-tricks.com/now-css-custom-properties-thing-value-parts-can-changed-individually/)\n\n\n\u0026nbsp;\n## Related\n- [Micromodal](https://github.com/Ghosh/micromodal) - Tiny javascript library for creating accessible modal dialogs\n\n\n\u0026nbsp;\n## Credits\n- [Claudio Holanda](https://twitter.com/kazzkiq) - Whose work inspired this project\n\n\u0026nbsp;\n\n\u003cp align=\"center\"\u003e✌️\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003csub\u003e\u003csup\u003eA little project by \u003ca href=\"https://twitter.com/_ighosh\"\u003e@i_ghosh\u003c/a\u003e\u003c/sup\u003e\u003c/sub\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":["CSS",":clap: 欢迎参与​","Frameworks / Resources"],"sub_categories":["ui框架","M"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghosh%2Fmicrotip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghosh%2Fmicrotip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghosh%2Fmicrotip/lists"}