Components renaming (#225)
* refactor: eslint config adjusted for better diff's * refactor: stricter linting + dependencies updated * refactoring: paragraph component - component - docs * refactoring: heading component - component - docs * Update docs/components/heading.md Co-authored-by: Ilya Artamonov <ilya.sosidka@gmail.com> * refactoring: link component - component - docs * refactoring: image component - component - docs * refactoring: alert component - component - docs * refactoring: avatar component - component - docs * refactoring: removed unnecessary code - component names come from the file name * refactoring: breadcrumb component - component - docs * refactoring: accordion component - component - docs * refactoring: buttom component - component - docs * refactoring: badge component - component - docs * refactoring: card component - component - docs * refactoring: order of components in docs updated * refactoring: unnecessary semicolons removed * refactoring: button group component - component - docs * refactoring: carousel component - component - docs * refactoring: dropdown component - component - docs * refactoring: footer component - component - docs * refactoring:list-group component - component - docs * refactoring: modal component - component - docs * refactoring: navbar component - component - docs * refactoring: pagination component - component - docs * refactoring: progress component - component - docs * refactoring: rating component - component - docs * refactoring: spinner component - component - docs * refactoring: table component - component - docs * refactoring: tabs component - component - docs * feat: Updated pagination examples * lint: Lister fixes * feat: Sidebar component and some fixes * feat: Input component * feat: Some fixes * feat: Some fixes * chore: update deps * refactor: removed old Modal component * refactor: radio component and some fixes * fix: fixed path error * refactor: Range component * refactoring: timeline component - component - docs * refactor: Select component * refactoring: toast component - component - docs * refactoring: tooltip component - component - docs * refactoring: sidebar component - component - docs * refactoring: input component - component - docs * refactoring: fileInput component - component - docs * refactoring: select component - component - docs * refactoring: textarea component - component - docs * refactoring: checkbox component - component - docs * refactoring: radio component - component - docs * refactoring: toggle component - component - docs * refactoring: range component - component - docs * local configs linted * documentation quick start updated * flowbite-themable refactored to fit new linters and style guide * random linter fixes * refactoring: toast-provider component - component - docs * final linter fixes * lint: Linter fixes * fix: Fixed types * fix: Fixed card component * docs: Updated card examples * fix: Fixed tabs * refactor: Heading component refactoring * Fwb rename - few fixes after component review (#237) * fix: button documentation * fix: model type in range examples * chore: Toast marked as WIP --------- Co-authored-by: Sqrcz <naorniakowski@slashlab.pl> Co-authored-by: Sqrcz <naorniakowski@gmail.com>
This commit is contained in:
@@ -1,80 +1,65 @@
|
||||
<script setup>
|
||||
import TooltipExample from './tooltip/examples/TooltipExample.vue'
|
||||
import TooltipPositionExample from './tooltip/examples/TooltipPositionExample.vue'
|
||||
import TooltipStyleExample from './tooltip/examples/TooltipStyleExample.vue'
|
||||
import TooltipTriggerExample from './tooltip/examples/TooltipTriggerExample.vue'
|
||||
import FwbTooltipExample from './tooltip/examples/FwbTooltipExample.vue'
|
||||
import FwbTooltipExamplePosition from './tooltip/examples/FwbTooltipExamplePosition.vue'
|
||||
import FwbTooltipExampleStyle from './tooltip/examples/FwbTooltipExampleStyle.vue'
|
||||
import FwbTooltipExampleTrigger from './tooltip/examples/FwbTooltipExampleTrigger.vue'
|
||||
</script>
|
||||
# Vue Tooltip - Flowbite
|
||||
|
||||
## Demo
|
||||
|
||||
<TooltipExample></TooltipExample>
|
||||
|
||||
<fwb-tooltip-example />
|
||||
```vue
|
||||
<script setup>
|
||||
import { Tooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Tooltip>
|
||||
<fwb-tooltip>
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Default Tooltip
|
||||
</button>
|
||||
<fwb-button>
|
||||
Default Tooltip
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</Tooltip>
|
||||
</fwb-tooltip>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { FwbButton, FwbTooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
```
|
||||
|
||||
## Tooltip styles
|
||||
|
||||
You can use choose between dark and light version styles for the tooltip component by changing the utility classes from Tailwind CSS and by applying the `tooltip-light` or `tooltip-dark` attribute.
|
||||
|
||||
<TooltipStyleExample />
|
||||
|
||||
<fwb-tooltip-example-style />
|
||||
```vue
|
||||
<script setup>
|
||||
import { Tooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap justify-center py-8 space-x-3">
|
||||
<!-- light style tooltip -->
|
||||
<Tooltip theme="light">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Light Tooltip
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</Tooltip>
|
||||
<!-- dark style tooltip -->
|
||||
<Tooltip theme="dark">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Dark Tooltip
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<fwb-tooltip theme="light">
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Light Tooltip
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
<fwb-tooltip theme="dark">
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Dark Tooltip
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { FwbButton, FwbTooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
```
|
||||
|
||||
## Placement
|
||||
@@ -82,73 +67,54 @@ import { Tooltip } from 'flowbite-vue'
|
||||
The positioning of the tooltip element relative to the triggering element (eg. button, link) can be set using placement attribute with `top`, `top-start` , `top-end`, `bottom`, `bottom-start`, `bottom-end`, `right`, `right-start`, `right-end`, `left`, `left-start`, `left-end`, `auto`, `auto-start`, `auto-end`.
|
||||
The default value is: `top`
|
||||
|
||||
<TooltipPositionExample />
|
||||
|
||||
<fwb-tooltip-example-position />
|
||||
```vue
|
||||
<script setup>
|
||||
import { Tooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap justify-center py-8 space-x-3">
|
||||
<!-- Show tooltip on top -->
|
||||
<Tooltip placement="top">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Tooltip top
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on top
|
||||
</template>
|
||||
</Tooltip>
|
||||
<!-- Show tooltip on right -->
|
||||
<Tooltip placement="right">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Tooltip right
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on right
|
||||
</template>
|
||||
</Tooltip>
|
||||
<!-- Show tooltip on bottom -->
|
||||
<Tooltip placement="bottom">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Tooltip bottom
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on bottom
|
||||
</template>
|
||||
</Tooltip>
|
||||
<!-- Show tooltip on left -->
|
||||
<Tooltip placement="left">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Tooltip left
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on left
|
||||
</template>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<fwb-tooltip placement="top">
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Tooltip top
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on top
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
<fwb-tooltip placement="right">
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Tooltip right
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on right
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
<fwb-tooltip placement="bottom">
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Tooltip bottom
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on bottom
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
<fwb-tooltip placement="left">
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Tooltip left
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip on left
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { FwbButton, FwbTooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
```
|
||||
|
||||
|
||||
@@ -157,43 +123,32 @@ import { Tooltip } from 'flowbite-vue'
|
||||
|
||||
You can choose the triggering event by using the `hover` or `click` attributes to choose whether you want to show the tooltip when hovering or clicking on the element. By default this option is set to `click`.
|
||||
|
||||
<TooltipTriggerExample />
|
||||
|
||||
<fwb-tooltip-example-trigger />
|
||||
```vue
|
||||
<script setup>
|
||||
import { Tooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap justify-center py-8 space-x-3">
|
||||
<!-- Show tooltip on hover -->
|
||||
<Tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Tooltip hover
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</Tooltip>
|
||||
<!-- Show tooltip on click -->
|
||||
<Tooltip trigger="click">
|
||||
<template #trigger>
|
||||
<button
|
||||
type="button"
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
||||
>
|
||||
Tooltip click
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<fwb-tooltip>
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Tooltip hover
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
<fwb-tooltip trigger="click">
|
||||
<template #trigger>
|
||||
<fwb-button>
|
||||
Tooltip click
|
||||
</fwb-button>
|
||||
</template>
|
||||
<template #content>
|
||||
Tooltip content
|
||||
</template>
|
||||
</fwb-tooltip>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { FwbButton, FwbTooltip } from 'flowbite-vue'
|
||||
</script>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user