From eb8f3dfa85da0ac5e00bac0fb49355e7674979c2 Mon Sep 17 00:00:00 2001 From: Asad Date: Mon, 10 Mar 2025 14:58:37 -0400 Subject: [PATCH] doc: updated table components props --- README.md | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 5f9c955..4886e40 100644 --- a/README.md +++ b/README.md @@ -482,11 +482,11 @@ export default ExampleFive; | **width** | number | Cell width in pixels | `null` | | **height** | number | Cell height in pixels | `null` | | **flex** | number | Flex value for the cell | `1` (if no width, height, or style) | -| **style** | Style | Container style | `null` | -| **textStyle** | Style | Text style for cell content | `null` | -| **borderStyle** | Object | Cell border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | -| **cellContainerProps** | ViewProps | Props passed to the cell container | `{}` | -| **onPress** | Function | Callback when cell is pressed | `null` | +| **style** | StyleProp | Container style | `null` | +| **textStyle** | StyleProp | Text style for cell content | `null` | +| **borderStyle** | BorderStyle | Cell border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | +| **cellContainer** | ViewProps | Props passed to the cell container | `{}` | +| **onPress** | (data: any) => void | Callback when cell is pressed | `null` | | **children** | ReactNode | Children to render inside the cell | `null` | ### `Row` Component Properties @@ -494,50 +494,51 @@ export default ExampleFive; | Prop | Type | Description | Default | |---|---|---|---| | **data** | Array | Array of data items for each cell in the row | Required | -| **style** | Style | Container style | `null` | +| **style** | StyleProp | Container style | `null` | | **widthArr** | number[] | Array of widths for each cell | `[]` | | **height** | number | Height for the entire row | `null` | | **flexArr** | number[] | Array of flex values for each cell in the row | `[]` | -| **textStyle** | Style | Text style applied to all cells in the row | `null` | -| **borderStyle** | Object | Border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | -| **cellTextStyle** | Function | Function to generate custom text styles for individual cells | `null` | -| **onPress** | Function | Callback when a cell is pressed | `null` | +| **textStyle** | StyleProp | Text style applied to all cells in the row | `null` | +| **borderStyle** | BorderStyle | Border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | +| **cellTextStyle** | (item: any) => StyleProp | Function to generate custom text styles for individual cells | `null` | +| **onPress** | (item: any) => void | Callback when a cell is pressed | `null` | ### `Rows` Component Properties | Prop | Type | Description | Default | |---|---|---|---| | **data** | Array> | 2D array of data for rows and cells | Required | -| **style** | Style | Container style | `null` | +| **style** | StyleProp | Container style | `null` | | **widthArr** | number[] | Array of widths for each column | `[]` | | **heightArr** | number[] | Array of heights for each row | `[]` | | **flexArr** | number[] | Array of flex values for each column | `[]` | -| **textStyle** | Style | Text style applied to all cells | `null` | +| **textStyle** | StyleProp | Text style applied to all cells | `null` | | **borderStyle** | Object | Border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | -| **onPress** | Function | Callback when a cell is pressed | `null` | +| **cellTextStyle** | (item: any) => StyleProp | Function to generate custom text styles for individual cells | `null` | +| **onPress** | (item: any) => void | Callback when a cell is pressed | `null` | ### `Col` Component Properties | Prop | Type | Description | Default | |---|---|---|---| | **data** | Array | Array of data items for each cell in the column | Required | -| **style** | Style | Container style | `null` | +| **style** | StyleProp | Container style | `null` | | **width** | number | Width for the entire column | `null` | | **heightArr** | number[] | Array of heights for each cell | `[]` | | **flex** | number | Flex value for the column | `null` | -| **textStyle** | Style | Text style applied to all cells in the column | `null` | -| **borderStyle** | Object | Border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | +| **textStyle** | StyleProp | Text style applied to all cells in the column | `null` | +| **borderStyle** | BorderStyle | Border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | ### `Cols` Component Properties | Prop | Type | Description | Default | |---|---|---|---| | **data** | Array> | 2D array of data for columns and cells | Required | -| **style** | Style | Container style | `null` | +| **style** | StyleProp | Container style | `null` | | **widthArr** | number[] | Array of widths for each column | `[]` | | **heightArr** | number[] | Array of heights for each cell in a column | `[]` | | **flexArr** | number[] | Array of flex values for each column | `[]` | -| **textStyle** | Style | Text style applied to all cells | `null` | +| **textStyle** | StyleProp | Text style applied to all cells | `null` | | **borderStyle** | Object | Border line width and color | `{ borderWidth: 0, borderColor: '#000' }` | ### `StickyTable` Component Properties @@ -547,12 +548,12 @@ export default ExampleFive; | **data** | Array> | Full table data including first column | Required | | **stickyColumnWidth** | number | Width of the sticky column | Required | | **columnWidths** | number[] | Widths for non-sticky columns | `[]` | -| **style** | Style | Style for the container | `null` | -| **cellStyle** | Style | Style for cells | `null` | -| **textStyle** | Style | Text style for cell content | `null` | -| **headerStyle** | Style | Style for header row | `null` | -| **headerTextStyle** | Style | Text style for header cells | `null` | -| **borderStyle** | Object | Border style | `{ borderWidth: 1, borderColor: '#000' }` | +| **style** | StyleProp | Style for the container | `null` | +| **cellStyle** | StyleProp | Style for cells | `null` | +| **textStyle** | StyleProp | Text style for cell content | `null` | +| **headerStyle** | StyleProp | Style for header row | `null` | +| **headerTextStyle** | StyleProp | Text style for header cells | `null` | +| **borderStyle** | BorderStyle | Border style | `{ borderWidth: 1, borderColor: '#000' }` | ---