export default () => (<TableContainer><Table><TableHead><TableRow><TableHeader><TableText /></TableHeader></TableRow></TableHead><TableBody><TableRow><TableData><TableText /></TableData></TableRow></TableBody><TableCaption /><TablePagination><TablePaginationFirstPageButton /><TablePaginationPreviousButton /><TablePaginationPageStats /><TablePaginationNextButton /><TablePaginationLastPageButton /></TablePagination></Table></TableContainer>)
Prop | Type | Default | Description |
---|---|---|---|
size | "sm" | "md" |"lg" | "md" | The overall size of the entire table. |
isHeaderSticky | boolean | false | When true, keeps the table header sticky to top when you scroll inside the table. |
Prop | Type | Default | Description |
---|---|---|---|
isSelected | boolean | false | If true, the table row will have the selected shading. |
Prop | Type | Default | Description |
---|---|---|---|
placement | "top" | "bottom" | "bottom" | If true, the table row will have the selected shading. |
Prop | Type | Default | Description |
---|---|---|---|
page | number | 0 | The zero-based index of the current page. |
rowsPerPage | number | -1 | The number of rows per page. Set -1 to display all the rows. |
onPageChange | function(event: any | null, page: number) => void | - | Callback fired when the page is changed. |
onRowsPerPageChange | function(event: any | null, rowsPerPage: number) => void | - | Callback fired when the number of rows per page is changed. |
rowsPerPage | number | -1 | The number of rows per page. Set -1 to display all the rows. |
rowsPerPage | number | -1 | The number of rows per page. Set -1 to display all the rows. |
rowsPerPage | number | -1 | The number of rows per page. Set -1 to display all the rows. |
// import the styled componentsimport {Container,Root,Head,Row,Header,Text,Body,Caption,Pagination,FirstPageButton,PreviousButton,PageStats,NextButton,LastPageButton,Data,} from "../components/core/table/styled-components"// import the createTable functionimport { createTable } from "@gluestack-ui/table"// Understanding the APIexport const { Table, TableContainer } = createTable({Container,Root,Head,Row,Header,Text,Body,Caption,Pagination,FirstPageButton,PreviousButton,PageStats,NextButton,LastPageButton,Data,})// Using the table componentexport default () => (<TableContainer><Table><TableHead><TableRow><TableHeader><TableText>Prop</TableText></TableHeader><TableHeader><TableText>Description</TableText></TableHeader><TableHeader><TableText>Default</TableText></TableHeader></TableRow></TableHead><TableBody><TableRow><TableData><TableText>Prop1</TableText></TableData><TableData><TableText>Prop1 description</TableText></TableData><TableData><TableText>default value</TableText></TableData></TableRow><TableRow><TableData><TableText>Prop2</TableText></TableData><TableData><TableText>Prop2 description</TableText></TableData><TableData><TableText>default value</TableText></TableData></TableRow><TableRow><TableData><TableText>Prop3</TableText></TableData><TableData><TableText>Prop3 description</TableText></TableData><TableData><TableText>default value</TableText></TableData></TableRow></TableBody><TableCaption /><TablePagination rowsPerPage={1}><TablePaginationFirstPageButton /><TablePaginationPreviousButton /><TablePaginationPageStats /><TablePaginationNextButton /><TablePaginationLastPageButton /></TablePagination></Table></TableContainer>)