@loke/ui

primitive-and-slot

core
237 linesSource

Primitive element system (17 HTML types) with asChild composition via Slot. createSlot, createSlottable, Slottable for compound slot patterns. dispatchDiscreteCustomEvent for React 18 batching. Prop merge order: handlers composed (child first then slot), style merged (child wins), className concatenated, all other props child-wins. Mental model: asChild means "render whatever you give me but behave like [element]."