mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-15 10:15:36 +02:00
✨ feat: Add qwik-react (#103)
This adds the following pages: The landing page (/) The pricing page (/pricing) The contact page (/contact) The changelog page (/changelog) Terms Of Service page (/terms) Privacy Policy (/privacy)
This commit is contained in:
24
packages/ui/src/tooltip.tsx
Normal file
24
packages/ui/src/tooltip.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { component$, Slot } from "@builder.io/qwik"
|
||||
import { cn } from "./design";
|
||||
|
||||
type Props = {
|
||||
position: "bottom" | "top" | "left" | "right",
|
||||
text: string;
|
||||
}
|
||||
|
||||
const textPosition = {
|
||||
top: "bottom-[125%] left-1/2 -ml-[60px] after:absolute after:left-1/2 after:top-[100%] after:-ml-[5px] after:border-[5px] after:border-[#000_transparent_transparent_transparent]"
|
||||
}
|
||||
|
||||
export const Tooltip = component$(({ position, text }: Props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Slot />
|
||||
{/**@ts-ignore */}
|
||||
<span class={cn("invisible absolute w-[120px] group-hover:visible group-hover:opacity-100 text-white bg-black text-center py-1 rounded-md", textPosition[position])} >
|
||||
{text}
|
||||
</span>
|
||||
</>
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user