A basic Svelte tooltip directive.

Overview

SVooltip

A basic Svelte tooltip directive. Powered by Floating UI.

Usage

<script>
	import { tooltip } from 'svooltip';
	import 'svooltip/svooltip.css'; // Include default styling
</script>

<button
	class="btn"
	use:tooltip={{
		content: "You're looking beautiful today!",
		placement: 'top-start',
		delay: [1000, 0],
		offset: 15,
		target: '#layers'
	}}
>
	Hover me for 1 second
</button>

Docs

View more information at: https://svooltip.vercel.app

Licence

See the LICENSE file for license rights and limitations (MIT).

Comments
  • Use Sass for basic styling

    Use Sass for basic styling

    Dear @Gibbu , Thank you so much for this minimalistic tooltip, I love it! 😃

    In our project, we use Sass and try to optimize the css output. Svooltip currently provides the basic styling only as css. Because of that, no matter how we @use oder @import the styles, we will always have some default values in our delivered css. For example the value var(--svooltip-bg, #444) will be delivered no matter what.

    We would like to avoid that. That´s why I would be glad to get the styles in Sass already.

    I think, it fits quite well to the minimalistic approach, because sass is already a dependency of the Svooltip project. So its just a little refactoring, not really adding anything new.

    I will implement that myself and make a pull request.

    opened by nika-d 7
  • Unable to import default styling after updating to 0.4.2

    Unable to import default styling after updating to 0.4.2

    Hi!

    After updating from 0.3.0 to 0.4.2 I am unable to import the default styling.

    Both import 'svooltip/styles.css'; and import 'svooltip/svooltip.css'; gives me:

    1:35:06 PM [vite] Internal server error: Missing "./styles.css" export in "svooltip" package
    

    I am using a pretty standard svelte kit setup with tailwindcss and postcss enabled.

    Let me know if I can provide more details.

    System:
        OS: Linux 5.4 Ubuntu 20.04.4 LTS (Focal Fossa)
        CPU: (8) x64 Intel(R) Xeon(R) Platinum 8268 CPU @ 2.90GHz
        Memory: 24.23 GB / 31.33 GB
        Container: Yes
        Shell: 5.0.17 - /bin/bash
      Binaries:
        Node: 18.11.0 - ~/.local/share/pnpm/node
        npm: 8.19.2 - ~/.local/share/pnpm/npm
      Browsers:
        Firefox: 107.0
      npmPackages:
        @sveltejs/adapter-node: 1.0.0-next.104 => 1.0.0-next.104 
        @sveltejs/kit: 1.0.0-next.583 => 1.0.0-next.583 
        @tailwindcss/forms: ^0.5.3 => 0.5.3 
        @types/sharp: ^0.31.0 => 0.31.0 
        @typescript-eslint/eslint-plugin: ^5.46.0 => 5.46.0 
        @typescript-eslint/parser: ^5.46.0 => 5.46.0 
        autoprefixer: ^10.4.13 => 10.4.13 
        eslint: ^8.29.0 => 8.29.0 
        eslint-config-prettier: ^8.5.0 => 8.5.0 
        eslint-plugin-svelte3: ^4.0.0 => 4.0.0 
        postcss: ^8.4.20 => 8.4.20 
        prettier: ^2.8.1 => 2.8.1 
        prettier-plugin-svelte: ^2.9.0 => 2.9.0 
        sharp: ^0.31.2 => 0.31.2 
        svelte: ^3.54.0 => 3.54.0 
        svelte-check: ^2.10.2 => 2.10.2 
        svooltip: ^0.4.2 => 0.4.2 
        tailwindcss: ^3.2.4 => 3.2.4 
        tslib: ^2.4.1 => 2.4.1 
        typescript: ^4.9.4 => 4.9.4 
        vite: ^4.0.0 => 4.0.0 
    opened by ollema 2
  • feature request: update content after delay

    feature request: update content after delay

    hi!

    thanks for creating svooltip, I use it in nearly all of my svelte projects.


    sometimes, I find that it would have been useful to different content in the tooltip depending on how long it has been hovered.

    say that first you could display:

    <username>
    

    but after for example 1 seconds, the content would change to:

    <username>
    <status>
    <bio>
    <email>
    

    I hope you get my idea, if not I would be happy to expand on this

    opened by ollema 2
  • Tootltips stay forever

    Tootltips stay forever

    Rapid pointer movement over a tooltipped element causes the tooltip to stay displayed forever.

    The delay parameter only delays displaying the tooltip, but the event is always fired.

    opened by PlkMarudny 2
  • `format: 'html'` not working as intended

    `format: 'html'` not working as intended

    Hi again!

    It seems like the format: 'html' is broken in the latest version(s).

    Here is a StackBlitz repro:

    https://stackblitz.com/edit/sveltejs-kit-template-default-f5rdtj?file=src/routes/+page.svelte

    I added the HTML tooltip from the doc site to the "Welcome" image. As you can see, it is not parsed correctly.

    Let me know if I need to provide additional information.

    opened by ollema 1
  • HTML in tooltip?

    HTML in tooltip?

    I would like to use HTML formatted strings in the tooltip content but not sure how to do so.

    If that's not possible yet, I would like to request it as an optional param e.g. format: "raw" | "html" that will internally use Svelte's {@html ... }

    opened by phenomen 1
A Svelte parser that compiles to Mitosis JSON, allowing you to write Svelte components once and compile to every framework.

Sveltosis Still in development A Svelte parser that compiles to Mitosis JSON, allowing you to write Svelte components once and compile to every framew

sveltosis 70 Nov 24, 2022
Add focal point alignment of images to your Alpine 3.x components with a custom directive.

Alpine Focal Add focal point alignment of images to your Alpine 3.x components with a custom directive. This package only supports Alpine v3.x. About

Michael Lefrancois 2 Oct 12, 2021
[WIP] A solid directive for adding colorful shadows to images.

solid-cosha A solid directive for adding colorful shadows to images (based on cosha). Quick start Install it: yarn add solid-cosha Use it: import { co

Robert Soriano 2 Feb 3, 2022
BASIC is a web application contains basic applications related to studies, love, health, weather, productivity. This project aim to simply the user's life in anyway.

BASIC is a web application contains basic applications related to studies, love, health, weather, productivity. This project aim to simply the user's life in anyway. Supported by all operating system, need an internet connection for working properly.

IRUTHAYA SANTHOSE I 1 Dec 19, 2021
This project will be a basic website that allows users to add/remove books from a list. The main objective is to understand how to use JavaScript objects and arrays and dynamically modify the DOM and add basic events.

Awesome-books Awesome Books This project will be a basic website that allows users to add/remove books from a list. This project is part of the Microv

Aleksandra Ujvari 10 Oct 3, 2022
Basic website that allows users to add/remove books from a list. Achieved using JavaScript objects and arrays, dynamically modifying the DOM and adding basic events.

Awesome Books Basic website that allows users to add/remove books from a list. Achieved using JavaScript objects and arrays, dynamically modifying the

Didier Peran Ganthier 6 Dec 20, 2022
A lightweight tooltip plug-in library

popper-next 是一款轻量的 Tooltip 插件 vue、react安装使用 推荐yarn yarn add popper-next 或者 cnpm install popper-next -S 在html页面中如何使用 <script src="https://unpkg.com/pop

east-wzd 4 Dec 7, 2022
A simple step by step tooltip helper for any site

Tooltip Sequence A minimalistic set of tooltips on your app. What it does So suppose you create a Web Application and you want to take your users or a

Sooraj Sivadasan Nair 299 Dec 21, 2022
Tooltip using only CSS and very low build size.

css-only-tooltip A very lightweight tooltip utitlity library, made using only CSS with dynamic light and dark themes. Insatallation Using npm $ npm in

Rajiv 4 Dec 11, 2022
Simple pure CSS ToolTip

PureCSSToolTip Simple pure CSS ToolTip purecsstooltip.css is used to the added tooltip for a web app, web page without javascript. This full of CSS co

Gokul S 3 Sep 19, 2022
The JavaScript library let’s you transform native tooltip’s into customizable overlays.

iTooltip The JavaScript library let’s you transform native tooltip’s into customizable overlays. Use: <script src="/path/to/iTooltip.js"></script> <sc

null 2 Dec 17, 2021
Might be mineral fish site in future, idk. Currently just a fish list. Made with Svelte

Might be mineral fish site in future, idk. Currently just a fish list. Made with Svelte. Built version (used at mineralfish.github.io) at the build branch. Build steps and original README below.

Mineral Fish 3 Nov 3, 2022
An Electron app using NAPI-RS and a native Rust module to implement a Svelte store.

Svelte Store Written in Rust This repo shows a demo of an Electron app running a Svelte UI that reads and writes a Svelte store, but with a twist: the

Dave Ceddia 27 Sep 20, 2022
Svelte debugging tool for re-rendering components

resvelte README This is the README for your extension "resvelte". After writing up a brief description, we recommend including the following sections.

OSLabs Beta 44 Oct 4, 2022
Internationalization for svelte framework. Based on i18next ecosystem

svelte-i18next Svelte wrapper for i18next npm i svelte-i18next i18next Implementation This library wraps an i18next instance in a Svelte Store to obs

Nishu Goel 20 Dec 9, 2022
Svelte component to render markdown.

svelte-exmarkdown Svelte component to render markdown. Motivation svelte-markdown is a good component package. However, it is not extensible. You cann

Sotaro Tommykawa 43 Jan 6, 2023
Simple and Extensible Markdown Parser for Svelte, however its simplicity can be extended to any framework.

svelte-simple-markdown This is a fork of Simple-Markdown, modified to target Svelte, however due to separating the parsing and outputting steps, it ca

Dave Caruso 3 May 22, 2022
Simple and lightweight form validation for Svelte with no dependencies.

Svelidate Simple and lightweight form validation for Svelte with no dependencies Installation // npm npm install svelidate // yarn yarn add svelidate

null 28 Dec 28, 2022
A ✨light✨ and magical Svelte component for CSS media queries🐹

Svelte CSS media queries ?? Demo - Svelte REPL Lightweight, comfortable, like Svelte ?? how to install npm i svelte-media-queries What can I do? quer

Nikita Fedorov 9 Dec 26, 2022