https://github.com/notprometey/react-slots
https://github.com/notprometey/react-slots
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/notprometey/react-slots
- Owner: NotPrometey
- Created: 2022-09-11T13:11:55.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-17T17:34:25.000Z (almost 4 years ago)
- Last Synced: 2025-04-09T04:39:52.091Z (about 1 year ago)
- Language: TypeScript
- Size: 630 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React slots
slots for react app. You can find a demo [here](https://notprometey.github.io/react-slots/)
[](https://www.npmjs.com/package/@notprometey/react-slots) [](https://standardjs.com)
## Install
```bash
npm install --save @notprometey/react-slots
```
## Usage
```tsx
import React from 'react'
import { Slot, withSlots } from '@notprometey/react-slots';
const Modal = () => {
return (
default content of default slot
default content of test slot
);
};
export default withSlots(Modal);
```
```tsx
import React from 'react'
import { Template } from '@notprometey/react-slots';
import Modal from './components/Modal';
const App = () => {
return (
content to default slot
content to test slot
);
};
```
## License
MIT © [notprometey](https://github.com/notprometey)