@hanamura/react-containers
Version:
Flexible container components for React
41 lines (40 loc) • 1.34 kB
TypeScript
import React from 'react';
import { Queries, AdaptiveOptions } from '../core';
/**
* Options for configuring the Switcher component
*/
export interface SwitcherOptions {
/** Content to display for the current breakpoint */
content: React.ReactNode;
}
/**
* Props for the Switcher component
*/
export interface SwitcherProps<K extends string = string> {
/**
* Override options applied to all breakpoints
*/
options?: SwitcherOptions;
/**
* Breakpoint media queries for responsive behavior
*/
queries?: Queries<K>;
/**
* Context-specific options that override defaults based on media queries
*/
adaptiveOptions?: AdaptiveOptions<K, SwitcherOptions>;
/**
* Optional fallback to display while initializing
*/
fallback?: React.ReactNode;
}
/**
* 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 declare function Switcher<K extends string = string>({ options, queries, adaptiveOptions, fallback }: SwitcherProps<K>): import("react/jsx-runtime").JSX.Element;