Skip to content

Commit

Permalink
docs: 📝 add tooltip component doc file
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-B-06 committed Jun 23, 2022
1 parent baa7969 commit d4a3281
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions docs/tooltip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Tooltip

AdaptUI provides a Tooltip Component which can be used to provide a brief,
informative message when a user interacts with an element.

#### Simple Usage

```
import { Tooltip, Button } from "@adaptui/react-native-tailwind"
export default function App() {
return (
<Tooltip
hasArrow
placement="top"
trigger={
<Button
style={tailwind.style("my-1")}
prefix={<Icon icon={<Clock />} />}
themeColor="success"
size="sm"
>
Progress on Top
</Button>
}
content="2 out 3 tasks completed"
/>
)
}
```

This component uses <Popover> component from
[`react-native-popper`](https://github.com/intergalacticspacehighway/react-native-popper)

## Props

| Name | Description | Type | Default |
| ------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| placement | Tooltip placement | `top` `bottom` `left` `right` `top left` `top right` `bottom left` `bottom right` `right top` `right bottom` `left top` `left bottom` | `bottom` |
| trigger | The trigger of the Tooltip | JSXELement | |
| content | The content of the Tooltip | JSXELement or string | |
| action | Action in which to show the Tooltip | JSXELement or string | |
| mainOffset | Distance between popover and trigger's main axis | number | 0 |
| crossOffset | Distance between popover and trigger's cross axis | number | 0 |
| hasArrow | Whether popover should have an arrow | boolean | false |
| shouldFlip | Whether the popover should flip if there's less space | boolean | true |
| isTooltipOpen | Is the Tooltip Open for Controlled popovers | boolean | |
| handleTooltipState | A callback to listen to change events also to set state for controlled popovers. | (isOpen: boolean) => void | |

0 comments on commit d4a3281

Please sign in to comment.