Pages · Laravilt
Utilities
The cn, urlIsActive and toUrl helpers plus the composables and hooks shipped with the app shell.
resources/js/lib/utils.ts is published for both stacks (tag laravilt-panel-lib) and exports the same three helpers.
React support requires Laravilt v1.1 or later.
cn()
Merges class names with clsx and resolves Tailwind conflicts with tailwind-merge:
typescript
urlIsActive()
urlIsActive(urlToCheck, currentUrl) is used by NavMain to highlight the current item:
typescript
urlToCheck may be a string or an Inertia link object ({ url, method }).
toUrl()
Returns the URL string from a string or an Inertia link object:
typescript
Composables and Hooks
Vue (@/composables/...) | React (@/hooks/...) | Purpose |
|---|---|---|
useAppearance | use-appearance | Light / dark / system theme |
useInitials | use-initials | Initials for avatar fallbacks |
useLocalization | use-localization | Translations and locale |
usePanelFont | use-panel-font | Loads the panel's configured font |
useTwoFactorAuth | use-two-factor-auth | Two-factor setup helpers |
Sidebar State
typescript
tsx
Inertia Helpers
Use Inertia's own usePage, useForm, Link and router from @inertiajs/vue3 or @inertiajs/react:
typescript