@ryvora/react-slot
Version:
🎰 Slot utility for composable React components. Pass props down and unlock asChild magic!
19 lines (16 loc) • 865 B
text/typescript
import * as React from 'react';
/** ----------------------------------------- Slot ----------------------------------------- */
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
children?: React.ReactNode;
}
/** @__NO_SIDE_EFFECTS__ */ declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
interface SlottableProps {
children: React.ReactNode;
}
interface SlottableComponent extends React.FC<SlottableProps> {
__ryvoraId: symbol;
}
/** @__NO_SIDE_EFFECTS__ */ declare function createSlottable(ownerName: string): SlottableComponent;
declare const Slottable: SlottableComponent;
export { Slot as Root, Slot, type SlotProps, Slottable, createSlot, createSlottable };