Skip to content

Commit

Permalink
feat: update README.md according to the new container slot changes
Browse files Browse the repository at this point in the history
  • Loading branch information
knightburton committed Oct 6, 2023
1 parent b823627 commit 6ef4628
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const App = () => (
weekStartsOn={1}
start={new Date(2021, 1, 1)}
end={new Date(2021, 6, 31)}
height={700}
/>
);

Expand All @@ -59,22 +58,13 @@ For more detailed example check the [example](./example) directory.
| onCellClick | function | `undefined` | Function called when the user clicks a cell. It returns a [Cell Data](#cell-data). |
| showHeader | boolean | `true` | Whether the whole header shall be shown or not. |
| weekStartsOn | number | `0` | The index of the day that the week should starts on. Can be `0`, `1`, `2`, `3`, `4`, `5` or `6`. |
| containerComponent | ComponentType<[ContainerProps](#container-props)> | `undefined` | React component that should be rendered as the main container component. For the passed props check the [ContainerProps](#container-props), please. |
| headerContainerComponent | ComponentType<[Header ContainerProps](#header-container-props)> | `undefined` | React component that should be rendered as the header container component. For the passed props check the [Header ContainerProps](#header-container-props), please.|
| headerCellContentComponent | ComponentType<[HeaderCellContentProps](#header-cell-content-props)> | `undefined` | React component that should be rendered as the header cell content component. For the passed props check the [HeaderCellContentProps](#header-cell-content-props), please. |
| bodyContainerComponent | ComponentType<[BodyContainerProps](#body-container-props)> | `undefined` | React component that should be rendered as the main body container component. For the passed props check the [BodyContainerProps](#body-container-props), please. |
| bodyCellContentComponent | ComponentType<[BodyCellContentProps](#body-cell-content-props)> | `undefined` | React component that should be rendered as the cell content component. For the passed props check the [BodyCellContentProps](#body-cell-content-props), please. |
| emptyComponent | ComponentType<[EmptyProps](#empty-props)> | `undefined` | React component that should be rendered as the empty date range message component. For the passed props check the [EmptyProps](#empty-props), please. |
| containerClassName | string | `''` | Classname(s) that should applied to the calendar container element. |
| headerContainerClassName | string | `''` | Classname(s) that should applied to the header container element. |
| headerRowClassName | string | `''` | Classname(s) that should applied to the header row (list) element. |
| headerCellClassName | string | `''` | Classname(s) that should applied to the header cell (list item) element. |
| headerCellContentClassName | string | `''` | Classname(s) that should applied to the header cell content element. |
| bodyContainerClassName | string | `''` | Classname(s) that should applied to the body container element. |
| bodyRowClassName | string | `''` | Classname(s) that should applied to the body row (list) element. |
| bodyCellClassName | string | `''` | Classname(s) that should applied to the cell (list item) element. |
| bodyCellContentClassName | string | `''` | Classname(s) that should applied to the cell content element. |
| emptyClassName | string | `''` | Classname(s) that should applied to the empty date range message element. |
| slots | [Slots](#slots) | `undefined` | The components used for each slot inside. |
| slotProps | [Slots](#slots) | `undefined` | The extra props for the slot components. You can override the existing props or add new ones. |

#### Cell Data
| Prop name | Type | Description |
Expand All @@ -99,12 +89,21 @@ For more detailed example check the [example](./example) directory.
| long | `string` | Day of the week formatted with the provided `locale` prop as `long` weekday. |
| narrow | `string` | Day of the week formatted with the provided `locale` prop as `narrow` weekday. |

#### Container Props
#### Slots
| Slot | Type | Description |
| --- | --- | --- |
| container | [ContainerSlots](#container-slots) | React components that should be rendered as the main container component. |

#### Container Slots
| Slot | Type | Description |
| --- | --- | --- |
| root | React.ElementType<[ContainerRootProps](#container-root-props)> | All the underlying elements that needs to be rendered to show the calendar content. |

#### Container Root Props
| Prop name | Type | Description |
| --- | --- | --- |
| children | `React.ReactNode` | All the underlaying elements that needs to be rendered to show the calendar content. |
| className | `string` | Merged classnames that includes the default one and the given one from `containerClassName` prop. |
| height | `number` or `'100%'` or `'auto'` | The same height prop that is given for the main component as a prop. |
| children | `React.ReactNode` | All the underlying elements that needs to be rendered to show the calendar content. |
| className | `string` | Merged classnames that includes the default one and the given one from `slotProps.container.root.className` prop. |

#### Header Container Props
| Prop name | Type | Description |
Expand Down

0 comments on commit 6ef4628

Please sign in to comment.