• Attach any Hydrateless enhancer to a host element for the lifetime of a component. Returns a template ref to bind onto the element you want enhanced plus a shallow ref to the enhancer's imperative API (e.g. setValue/setOpen). The enhancer runs client-side only (so components stay SSR-safe) and is destroyed automatically on unmount. Pass a reactive source to destroy and re-attach whenever an enhancer option changes.

    <script setup>
    const { host, api } = useEnhancer((el) => enhanceTabs(el));
    // api.value?.setValue('two');
    </script>
    <template><div data-hl-tabs ref="host"></div></template>

    Type Parameters

    • Api = null

    Parameters

    • enhance: (el: HTMLElement) => EnhancerHandle<Api>
    • Optionalsource: WatchSource<unknown>

    Returns { api: ShallowRef<null | Api>; host: Ref<null | HTMLElement> }