Skip to content

NotPrometey/react-slots

Repository files navigation

React slots

slots for react app. You can find a demo here

NPM JavaScript Style Guide

Install

npm install --save @notprometey/react-slots

Usage

import React from 'react'
import { Slot, withSlots } from '@notprometey/react-slots';

const Modal = () => {
  return (
    <div>
      <Slot>default content of default slot</Slot>
      <Slot name='test'>default content of test slot</Slot>
    </div>
  );
};

export default withSlots(Modal);
import React from 'react'
import { Template } from '@notprometey/react-slots';

import Modal from './components/Modal';

const App = () => {
  return (
    <Modal>
      <span>content to default slot</span>
      <Template slot='test'>content to test slot</Template>
    </Modal>
  );
};

License

MIT © notprometey

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published