docs: migrate UI docs (#13245)
* docs: create a new UI docs project (#13233) * docs: create a new UI docs project * fix installation errors * docs: migrate UI docs content to new project (#13241) * Fix content * added examples for some components * finish adding examples * lint fix * fix build errors * delete empty files * path fixes + refactor * fix build error
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import { ComponentExample } from "@/components/ComponentExample"
|
||||
import { ComponentReference } from "@/components/ComponentReference"
|
||||
|
||||
export const metadata = {
|
||||
title: `Tooltip`,
|
||||
}
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
|
||||
A component that displays a pop-up with additional information when hovering over or focusing on an element.
|
||||
|
||||
In this guide, you'll learn how to use the Tooltip component.
|
||||
|
||||
<ComponentExample name="tooltip-demo" />
|
||||
|
||||
## Usage
|
||||
|
||||
```tsx
|
||||
import { Tooltip } from "@medusajs/ui"
|
||||
```
|
||||
|
||||
```tsx
|
||||
<Tooltip content="Tooltip content">Trigger</Tooltip>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## API Reference
|
||||
|
||||
<ComponentReference mainComponent="Tooltip" />
|
||||
|
||||
---
|
||||
|
||||
## Usage Outside Medusa Admin with TooltipProvider
|
||||
|
||||
If you're using the `Tooltip` component in a project other than the Medusa Admin, make sure to include the `TooltipProvider` somewhere up in your component tree:
|
||||
|
||||
```tsx
|
||||
<TooltipProvider>
|
||||
<Tooltip content="Tooltip content">Trigger</Tooltip>
|
||||
</TooltipProvider>
|
||||
```
|
||||
|
||||
### TooltipProvider Reference
|
||||
|
||||
<ComponentReference mainComponent="TooltipProvider" />
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
### Changing Tooltip Side
|
||||
|
||||
<ComponentExample name="tooltip-sides" />
|
||||
|
||||
### Set Tooltip Max Width
|
||||
|
||||
<ComponentExample name="tooltip-maxwidth" />
|
||||
Reference in New Issue
Block a user