Giter VIP home page Giter VIP logo

butter-accordion's Introduction

Butter-Collapsible



butter-collapsible logo

๐Ÿ›  A simple and lightweight React collasible package.

Package version. Make a pull request.


โšก๏ธ Features

  • Easy to use
  • Lightweight (~4kb Gzip)
  • Fully responsive.
  • Highly customizable.
  • No 3rd party dependencies.
  • Typescript


๐Ÿ’พ Installation

$ npm i butter-collapsible
$ yarn add butter-collapsible


๐Ÿ“„ Basic Usage

// Import statement
import { Collapsible } from "butter-collapsible";

// Here's an example of how to use it
export const MyComponent = () => {
  return (
    <>
      <Collasible
        trigger="Click me to see more"
        content="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ducimus officia voluptate totam minima cum? Laboriosam, recusandae veritatis dolore saepe quibusdam nesciunt esse delectus aut consequuntur ex aliquid, enim cupiditate commodi!"
        roundedSize={"lg"}
      />
    </>
  );
};


๐Ÿช„ Props

Here's a table of all available props for the Collapsible.



๐Ÿงฉ General props

Prop Description Type default
trigger* The part of the collapsible that you click to expand. string | JSX.Element
content* The part shown after the collapsible is expanded. string | JSX.Element
rounded Determines whether the collapsible wrapper would be rounded. boolean true
roundedSize Sets the size of the collapsible wrapper's rounded corners. sm | md | lg | xl md
triggerIcon Icon at the left of collapsible trigger string | JSX.Element +
color Applied as collapsible wrapper border color string #333333
borderWidth Applied as collapsible wrapper border width number 2
paddingSize Applied as collapsible wrapper padding size sm | md | lg | xl md


๐Ÿ‘ท๐Ÿฝ Contribution Guide

Butter-Collapsible is an opensource project and public contribution is always welcomed. You can check Issues for bugs to fix or features to add.

  1. Fork this repository.
  2. Clone the forked repository to your local machine.
  3. Create a new branch with a name like this - feature/name-of-feature.
  4. Run npm to install dependencies.
  5. Write code and then commit changes.
  6. Run npm run build to compile a build into the dist folder.
  7. Now You can decide to manually copy the index.tsx and index.scss file from here into a local project in order to test the feature/bug you have fixed.
  8. Alternatively, run npm link in your local butter-collapsible root folder.
  9. On the local project you want to test the features on, run npm link 'butter-collapsible'.
  10. Now navigate back to the terminal on your local butter-collapsible folder and then run npm link ../path-to-test-project/node_modules/react. This will make butter-collapsible use the copy of react from your local test project. Now you can test your changes.
  11. After all is done, push to your forked repository and then send a pull request.


โš–๏ธ Licence

MIT (c) Raymond Duru-young.

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.