UNPKG

@ark-ui/vue

Version:

A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.

44 lines (43 loc) 1.09 kB
import { MaybeRef } from 'vue'; import { UsePresenceReturn } from '../presence/use-presence.js'; export interface UseSwapProps { /** * Whether the swap is in the "on" state. * @default false */ swap?: boolean; /** * Whether to enable lazy mounting. */ lazyMount?: boolean; /** * Whether to unmount on exit. */ unmountOnExit?: boolean; } export interface IndicatorProps { type: 'on' | 'off'; } export interface UseSwapReturn { /** * Whether the swap is in the "on" state. */ swap: boolean; /** * The presence instance for the "on" indicator. */ onPresence: UsePresenceReturn; /** * The presence instance for the "off" indicator. */ offPresence: UsePresenceReturn; /** * Props for the root element. */ getRootProps: () => Record<string, unknown>; /** * Props for the indicator element. */ getIndicatorProps: (props: IndicatorProps) => Record<string, unknown>; } export declare const useSwap: (props: MaybeRef<UseSwapProps>) => UseSwapReturn;