-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Accordion | ||
|
||
This control allows you to render an accordion control. | ||
|
||
Here is an example of the control in action: | ||
|
||
![Accordion control](../assets/accordion.png) | ||
|
||
## How to use this control in your solutions | ||
|
||
- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency. | ||
- In your component file, import the `Accordion` control as follows: | ||
|
||
```TypeScript | ||
import { Accordion } from "@pnp/spfx-controls-react/lib/Accordion"; | ||
``` | ||
|
||
- Use the `Accordion` control in your code as follows: | ||
|
||
```TypeScript | ||
{ | ||
sampleItems.map((item, index) => ( | ||
<Accordion title={item.Question} defaultCollapsed={true} className={"itemCell"} key={index}> | ||
<div className={"itemContent"}> | ||
<div className={"itemResponse"}>{item.Reponse}</div> | ||
<div className={"itemIndex"}>{`Langue : ${item.Langue.Nom}`}</div> | ||
</div> | ||
</Accordion> | ||
)) | ||
} | ||
``` | ||
|
||
## Implementation | ||
|
||
The `Accordion` control can be configured with the following properties: | ||
|
||
| Property | Type | Required | Description | Default | | ||
| ---- | ---- | ---- | ---- | ---- | | ||
| title | string | yes | The title in the accordion to display. | | | ||
| defaultCollapsed | boolean | no | Is the accordion by default collapsed? | false | | ||
| className | string | no | Additional class name to add to your accordion. | | | ||
|
||
|
||
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/Accordion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters