Giter VIP home page Giter VIP logo

thegrtnx / react-simple-offcanvas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awran5/react-simple-offcanvas

0.0 0.0 0.0 1.76 MB

React component for adding a hidden sidebars to your project. Simply this is a Bootstrap 5 Offcanvas component but without installing any dependencies.

Home Page: https://react-offcanvas.vercel.app/

License: MIT License

JavaScript 17.69% TypeScript 49.26% CSS 18.22% HTML 14.83%

react-simple-offcanvas's Introduction

React Simple Offcanvas

React component for adding a hidden sidebars to your project. Simply this is a Bootstrap 5 Offcanvas component but without installing any dependencies.


NPM npm bundle size GitHub

screenshot

Install

npm

npm i react-simple-offcanvas

Yarn

yarn add react-simple-offcanvas

Usage

import React from 'react'
import { OffcanvasProvider, Trigger, Offcanvas } from 'react-simple-offcanvas'

export default function App() {
  return (
    <OffcanvasProvider { /* Provider props */ }>
      <Trigger { /* Trigger props */ } />
      <Offcanvas { /* Offcanvas props */ } />
    </OffcanvasProvider>
  )
}

1. Provider Props

Prop Type Options Description Default
onOpen Function Optional Callback function that is triggered when the Offcanvas is opened -
onClose Function Optional Callback function that is triggered when the Offcanvas is closed -

2. Trigger Props

Prop Type Options Description Default
component String Optional Render Component button | div button
className String Optional CSS className applied to the Trigger Block offcanvas-trigger
styles CSSProperties Optional Inline style {}
children ReactNode Optional Component children -

3. Offcanvas Props

Prop Type Options Description Default
title String Optional Offcanvas Title (h5 Tag) Offcanvas Title
position String Optional left | right | top | bottom right
backdrop boolean Optional Apply a backdrop on body while offcanvas is open true
allowClickAway boolean Optional Closes the offcanvas when user click outside true
allowEsc boolean Optional Closes the offcanvas when escape key is pressed true
allowScroll boolean Optional Allow body scrolling while offcanvas is open true
className String Optional CSS className applied to the Offcanvas Block simple-offcanvas
styles CSSProperties Optional Inline style {}
children ReactNode Optional Component Children Some text as placeholder


Edit react-simple-offcanvas

License

MIT © awran5

react-simple-offcanvas's People

Contributors

awran5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.