@hanamura/react-containers
Version:
Flexible container components for React
17 lines • 705 B
JavaScript
'use client';
import { useAdaptiveContainer } from '../core';
/**
* Switcher component - displays different content based on the active breakpoint
*
* Features:
* - Switches between different content elements based on current breakpoint
* - Renders whatever content is specified for the active breakpoint
* - Only renders one content element at a time
* - Does not add any additional container element
*/
export function Switcher({ options, queries, adaptiveOptions }) {
// Get the current options based on active breakpoint
const { options: mergedOptions } = useAdaptiveContainer(options, queries, adaptiveOptions);
return mergedOptions.content;
}
//# sourceMappingURL=Switcher.js.map