/resources/js/Components/ui
Shadcn-vue components: https://www.shadcn-vue.com/docs/components
Animations
Some components have included animations on scroll, hover or click, such as featured image, icons in feature cards, numbers in stats, testimonials, etc. If you want to disable animations globally, setVITE_ANIMATIONS
in .env
file to empty.
You can also pass animate
property to each of those components to enable or disable animations per component. You can find more info in docs for each of those components.
Blurred backdrop
Dialogs, sheets and drawers have backdrop that blurs the content beneath it. If you want to use only backdrop background color, without the blur, setVITE_BACKDROP_BLUR
in .env
file to backdrop-blur-none
.
If you want to use different blur value, set VITE_BACKDROP_BLUR
in .env
file to one of available classes. Default value is backdrop-blur-sm
.
If your new class is not working, make sure to safelist the class in tailwind.config.js
under safelist
array.
Tooltips
Shadcn-vue Tooltip component: https://www.shadcn-vue.com/docs/components/tooltip.html To render tooltip just follow the docs or search forToolTipProvider
in the source code.
There is a minor bug
when using tooltips:
If you have an element with tooltip inside your popover
, dialog
, dropdown
or any similar element with open and close states, the first tooltip will be rendered when you open it.
Use this code to prevent tooltip auto-show (check radix-vue docs for exact names)
modules/Roadmap/resources/js/Pages/Show.vue
.
Dialogs
In some cases we are required to manipulate dialog states. To make it seemless there is composableresources/js/composable/useDialog.ts
which you can use to control dialog states.
It can be used with any component with open/close state such as
Dialog
,
AlertDialog
, Popover
, Sheet
, etc.How to use it?
Import the composable:isOpen
presents dialog state which tells you if dialog is open (true) or closed (false).
openDialog
and closeDialog
are functions to open or close the dialog.
Then you can use it to set the dialog’s v-model: