# preact-slots **Repository Path**: mirrors_developit/preact-slots ## Basic Information - **Project Name**: preact-slots - **Description**: 🕳 Render Preact trees into other Preact trees, like portals. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-08-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
# preact-slots [![npm](https://img.shields.io/npm/v/preact-slots.svg?style=flat)](https://www.npmjs.org/package/preact-slots) [![travis](https://travis-ci.org/developit/preact-slots.svg?branch=master)](https://travis-ci.org/developit/preact-slots) Render Preact trees into other Preact trees, like portals. ## Install **preact-slots** is available on npm: `npm install --save preact-slots` ### Usage Define "holes" in your appliation using ``, then fill them using `some content`: ```js import { SlotProvider, Slot, SlotContent } from 'preact-slots' render(
Some Fallback Content Replacement Content
) ``` The above renders `
Replacement Content
`. An extended example follows: ```js import { Slot, SlotContent, SlotProvider } from 'preact-slots' const Header = () => (
Slots Demo { items => items && }
) const EditPage = ({ page, content, onSave, onCancel }) => (
Editing {page}