Document List
Renders a vertical and selectable list of DocumentBoxes, with an ActionBar
- Import
import { DocumentList } from '@smile/haring-react'; - Extends SelectableList
- Source View Source Code
- Package @smile/haring-react
- Storybook Storybook
Storybook Docs
Props
| Name | Type | Default | Description |
|---|---|---|---|
| documents * | IDocument[] | - | |
| selectedDocuments * | IDocument[] | - | |
| action | IAction<IDocument | IDocument[]>[] | - | |
| actionBarProps | Omit<IActionBarProps<IDocument>, 'actions' | 'selectedElements' > | - | Extra props for the internal ActionBar component, omitting actions and selectedElements which are handled by this component |
| onDocumentSelected | (document: IDocument, isSelected: boolean) => void | - | Called when |
| ... | - | - | extends SelectableList props, omitting children, onSelectChange and selectedIndexes which are handled by this component |
IDocument
A data object that will be rendered as a DocumentBox in the list
| Attribute | Type | Description |
|---|---|---|
| id * | number | string | Internal ID of the object, not displayed |
| author | string | Text displayed as the author of the document |
| content | ReactNode | Main content displayed in the document box |
| date | string | Text displayed as the date of the document |
| iconType | [IconMap](../../shared-types/icon-map) | Icon indicating the filetype of the document, one of the IconMap values |
| path | string | Text displayed as the path of the document |
| title | string | Text displayed as the title of the document |