Git Product home page Git Product logo

react-accordion-collapsible's Introduction

React Accordion Collapsible

A simple, clean, responsive and highly customizable accordion component for React projects. Find it on npm here

react-accordion-collapsible

Installing

npm install react-accordion-collapsible

The package does not require the downloading of any external dependencies :)

Using the package

import React from 'react'
import { Accordion } from 'react-accordion-collapsible'

const Example = () => {
  return (
    <Accordion
      title="Example title for React Accordion Collapsible"
      content="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
    />
  )
 }

export default Example

Examples

Check out some usage examples in the /examples folder

Props

prop isRequired default type description
id - - number unique id
title yes - string title of the accordion
content yes - string text content of the accordion
wrap - false boolean whether to wrap the accordion or let it take full width of parent(default)
defaultOpen - false boolean should the accordion be opened(expanded) by default
expandIcon - + ReactElement React element to replace the default expand icon (+)
collapseIcon - - ReactElement React element to replace the default collapse icon (-)
animation - true boolean whether to animate the opening and closing of the accordion
animationDuration - 0.25 number or string the animation duration
children - - ReactNode children of the component, if it is not defined as self closing
reverseIconPosition - false boolean reverse the expand and collapse icons positions to left side
iconSize - 16 number size of expand and collapse icons
onClick - - function function called when the accordion is clicked
onExpand - - function function called when the accordion is opened
onCollapse - - function function called when the accordion is closed
activeTitleColor - #22242E string color of the title when accordion is opened
contentCharLimit - null number maximum length of the content

Github Repository

github.com/yatish1606/react-accordion-collapsible

Customizing the UI

Every UI layer exposes a className property for that HTML element. You can directly include styles for required element in your index.css file or component.css.

react-accordion-collapsible's People

Contributors

yatish1606 avatar

Stargazers

Bhavesh Choudhari avatar  avatar Maitreya Kanitkar avatar Gaurav Khairnar avatar

Watchers

James Cloos avatar  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.