import type { Meta, StoryObj } from '@storybook/nextjs-vite'
import { Info, HelpCircle, Settings, Copy, Check, Trash2, Download, Share2 } from 'lucide-react'
import { useState } from 'react'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../components/ui/tooltip'
import { Button } from '../components/ui/button'
const meta = {
title: 'UI/Tooltip',
decorators: [
(Story) => (
),
],
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
} satisfies Meta
export default meta
type Story = StoryObj
/**
* Basic tooltip on an icon button.
*/
export const Default: Story = {
render: () => (
Settings
),
}
/**
* Info icon with an explanatory tooltip — common pattern for forms and dashboards.
*/
export const InfoHelper: Story = {
render: () => (
Monthly active users
Unique users who performed at least one action in the last 30 days.
),
}
/**
* Tooltip positioning — all four sides.
*/
export const Placement: Story = {
render: () => (
Tooltip on topTooltip on leftTooltip on rightTooltip on bottom
),
}
/**
* Icon toolbar with tooltips — common pattern for action bars.
*/
export const IconToolbar: Story = {
render: () => (
),
}
/**
* Tooltip on a disabled button — uses a wrapper span so the trigger still receives hover events.
*/
export const DisabledButton: Story = {
render: () => (
You need admin permissions to deploy.
),
}
/**
* Truncated text with a tooltip showing the full value.
*/
export const TruncatedText: Story = {
render: () => (
This is a very long text string that will be truncated in the container
This is a very long text string that will be truncated in the container