DocSpace-buildtools/packages/components/access-right-select/README.md

53 lines
1.5 KiB
Markdown
Raw Normal View History

# AccessRightSelect
### Usage
```js
import AccessRightSelect from "@docspace/components/AccessRightSelect";
```
```jsx
<AccessRightSelect
2022-01-27 13:45:02 +00:00
options={options}
onSelect={(option) => console.log("selected", option)}
selectedOption={{
key: "key1",
title: "Room administrator",
description: `Administration of rooms, archiving of rooms, inviting and managing users in rooms.`,
icon: AccessCommentReactSvgUrl,
2022-01-27 13:45:02 +00:00
quota: "free",
color: "#20D21F",
}}
/>
```
2022-01-27 14:29:39 +00:00
#### Options is an array of objects that contains the following fields:
- key
- title
- description
- icon
- quota
- color
##### Example:
```js
{
key: "key1",
2022-01-27 14:29:39 +00:00
title: "Room administrator",
description: `Administration of rooms, archiving of rooms, inviting and managing users in rooms.`,
icon: AccessCommentReactSvgUrl,
quota: "free",
color: "#20D21F",
}
```
### Properties
2022-01-27 12:58:56 +00:00
| Props | Type | Required | Values | Default | Description |
| ---------------- | :------------: | :------: | :----: | :-----: | ------------------------------------------------------------------ |
2022-01-27 14:29:39 +00:00
| `options` | `obj`, `array` | ✅ | - | - | List of options |
2022-01-27 12:58:56 +00:00
| `onSelect` | `obj`, `array` | - | - | - | Will be triggered whenever an AccessRightSelect is selected option |
| `selectedOption` | `obj` | - | - | - | The option that is selected by default |