diff --git a/README.md b/README.md
index 32eddcc7..9732e325 100644
--- a/README.md
+++ b/README.md
@@ -11,14 +11,13 @@
First, grab the package from npm:
```sh
-npm install --save react-accessible-accordion react react-dom
+npm install --save react-accessible-accordion
```
Then, import the editor and use it in your code. Here is a [basic example](https://springload.github.io/react-accessible-accordion/):
```jsx
import React from 'react';
-import ReactDOM from 'react-dom';
import {
Accordion,
@@ -30,29 +29,39 @@ import {
// Demo styles, see 'Styles' section below for some notes on use.
import 'react-accessible-accordion/dist/fancy-example.css';
-const Example = () => (
- Body content Body content
+ Exercitation in fugiat est ut ad ea cupidatat ut in
+ cupidatat occaecat ut occaecat consequat est minim minim
+ esse tempor laborum consequat esse adipisicing eu
+ reprehenderit enim.
+
+ In ad velit in ex nostrud dolore cupidatat consectetur
+ ea in ut nostrud velit in irure cillum tempor laboris
+ sed adipisicing eu esse duis nulla non.
+ Simple title
- Complex title
-
+ React Component for creating an 'Accordion' that adheres to the{' '} + + WAI ARIA spec + {' '} + for accessibility. +
+ ++ By default, only one item may be expanded and it can only be + collapsed again by expanding another. +
- Accessible Accordion component for React. Inspired by{' '} - - rc-collapse - {' '} - and{' '} - - react-sanfona - - . -
-| name | -type | -default | -description | -
|---|---|---|---|
| allowMultipleExpanded | -Boolean | -false | -- Don't close all the others when expanding an - AccordionItem - | -
| allowZeroExpanded | -Boolean | -false | -- Close an AccordionItem when it's the only - one expanded - | -
| onChange | -Function(keys) | -noop | -Triggered on change (open/close items) | -
| className | -String | -accordion | -CSS class(es) applied to the component | -
| name | -type | -default | -description | -
|---|---|---|---|
| expanded | -Boolean | -false | -Expands this item on first render | -
| className | -String | -accordion__item | -CSS class(es) applied to the component | -
| name | -type | -default | -description | -
|---|---|---|---|
| className | -String | -accordion__heading | -CSS class(es) applied to the component | -
| name | -type | -default | -description | -
|---|---|---|---|
| className | -String | -accordion__panel | -CSS class(es) applied to the component | -
| expandedClassName | -String | -accordion__panel--expanded | -Class name for expanded panel state | -
| name | -type | -default | -description | -
|---|---|---|---|
| expanded | -Boolean | -false | -Expands this item on first render | -
| children | -Function | -null | -- Takes expanded state as argument for - conditional rendering - | -
+ If you set allowMultipleExpanded to{' '} + true then the accordion will permit multiple items + to be expanded at once. +
+ +| name | -type | -default | -description | -
|---|---|---|---|
| allowMultipleExpanded | -Boolean | -false | -- Don't close all the others when - expanding an AccordionItem - | -
| onChange | -Function(keys) | -noop | -- Triggered on change (open/close - items) - | -
| className | -String | -accordion | -- CSS class(es) applied to the - component - | -
| name | -type | -default | -description | -
|---|---|---|---|
| expanded | -Boolean | -false | -- Expands this item on first - render - | -
| className | -String | -accordion__item | -- CSS class(es) applied to the - component - | -
| name | -type | -default | -description | -
|---|---|---|---|
| className | -String | -accordion__heading | -- CSS class(es) applied to the - component - | -
| name | -type | -default | -description | -
|---|---|---|---|
| className | -String | -accordion__panel | -- CSS class(es) applied to the - component - | -
| expandedClassName | -String | -accordion__panel--expanded | -- Class name for expanded panel - state - | -
| name | -type | -default | -description | -
|---|---|---|---|
| expanded | -Boolean | -false | -- Expands this item on first - render - | -
| children | -Function | -null | -- Takes expanded state as argument - for conditional rendering - | -
- Clone the project on your computer, and install Node. - This project also uses nvm. -
-
- nvm install
-
- # Then, install all project dependencies.
-
- npm install
-
- # Set up a `.env` file with the appropriate secrets.
-
- touch .env
-
+ If you set allowZeroExpanded to{' '} + true then a solitary expanded item may be collapsed + again. +
+ +- Everything mentioned in the installation process should - already be done. -
-
- # Make sure you use the right node version.
-
- nvm use
-
- # Start the the development tools in watch mode.
-
- yarn start
-
- # Runs linting.
-
- yarn lint
-
- # Runs tests.
-
- yarn test
-
- # View other available commands with:
-
- yarn
-
- Everything mentioned in the installation process should - already be done. -
-
- # Make sure you use the right node version.
-
- nvm use
-
- # Start the server and the development tools.
-
- yarn start-demo
-
- Everything mentioned in the installation process should - already be done. -
-
- # Make sure you use the right node version.
-
- nvm use
-
- # Start the the development tools in watch mode.
-
- yarn start
-
- # Runs linting.
-
- yarn lint
-
- # Runs tests.
-
- yarn test
-
- # View other available commands with:
-
- yarn
-
- Everything mentioned in the installation process should - already be done. -
-
- # Make sure you use the right node version.
-
- nvm use
-
- # Start the server and the development tools.
-
- yarn start-demo
-
TODO
-Did you notice the animation on the arrow?
-Check css/demo.css in the demo/ folder :)
-Why would you need more than one?
-+ When you use the onChange prop, you can get + feedback about which items are expanded. +
-+ In this example, we are simply logging the uuids of the expanded + items to the console. Have a click around then check your console to + see this in action. +
- If you open/close this item you should see - `uniqueItem-1` printed in the console. -
-- If you open/close this item you should see - `uniqueItem-2` printed in the console. -
-@@ -765,16 +157,8 @@ const Example = (): JSX.Element => (
@@ -791,4 +175,4 @@ const Example = (): JSX.Element => (