Skip to content

Commit c45dc2c

Browse files
committed
[docs] add advance section
1 parent 6e4c21e commit c45dc2c

3 files changed

Lines changed: 126 additions & 1 deletion

File tree

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,67 @@ You can use the [`AutoResizer`](https://autodesk.github.io/react-base-table/api/
3838

3939
_You have to polyfil `Array.prototype.findIndex` to make it works on IE_
4040

41+
## Advance
42+
43+
BaseTable is designed to be the base component to build your own complex table component
44+
45+
### Styling
46+
47+
The simplest way is overriding the default styles (assuming you are using `scss`)
48+
49+
```scss
50+
// override default variables for BaseTable
51+
$table-prefix: AdvanceTable;
52+
53+
$table-font-size: $bim-font-size-small;
54+
$table-border-radius: 4px;
55+
$table-padding-left: 15px;
56+
$table-padding-right: 15px;
57+
$column-padding: 7.5px;
58+
...
59+
$show-frozen-rows-shadow: false;
60+
$show-frozen-columns-shadow: true;
61+
62+
@import '~react-base-table/es/_BaseTable.scss';
63+
64+
.#{$table-prefix} {
65+
&:not(.#{$table-prefix}--show-left-shadow) {
66+
.#{$table-prefix}__table-frozen-left {
67+
box-shadow: none;
68+
}
69+
}
70+
71+
&:not(.#{$table-prefix}--show-right-shadow) {
72+
.#{$table-prefix}__table-frozen-right {
73+
box-shadow: none;
74+
}
75+
}
76+
77+
...
78+
}
79+
```
80+
81+
You can write your own styles from scratch or use CSS-in-JS solutions to achieve that
82+
83+
### Custom components
84+
85+
```jsx
86+
<BaseTable
87+
classPrefix="AdvanceTable"
88+
components={{
89+
TableCell: AdvanceTableCell,
90+
TableHeaderCell: AdvanceTableHeaderCell,
91+
ExpandIcon: AdvanceExpandIcon,
92+
SortIndicator: AdvanceSortIndicator,
93+
}}
94+
...
95+
/>
96+
```
97+
98+
### Custom renderers & props
99+
100+
There are a lot of highly flexible props like `xxxRenderer` and `xxxProps` for you to build your own table component, please check the [api](https://autodesk.github.io/react-base-table/api) and [examples](https://autodesk.github.io/react-base-table/examples) for more details
101+
41102
## Contributing
42103

43-
Please check [guidelines](CONTRIBUTING.md) for more details.
104+
Please check [guidelines](CONTRIBUTING.md) for more details

docs/advance.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## Advance
2+
3+
BaseTable is designed to be the base component to build your own complex table component
4+
5+
### Styling
6+
7+
The simplest way is overriding the default styles (assuming you are using `scss`)
8+
9+
```scss
10+
// override default variables for BaseTable
11+
$table-prefix: AdvanceTable;
12+
13+
$table-font-size: $bim-font-size-small;
14+
$table-border-radius: 4px;
15+
$table-padding-left: 15px;
16+
$table-padding-right: 15px;
17+
$column-padding: 7.5px;
18+
...
19+
$show-frozen-rows-shadow: false;
20+
$show-frozen-columns-shadow: true;
21+
22+
@import '~react-base-table/es/_BaseTable.scss';
23+
24+
.#{$table-prefix} {
25+
&:not(.#{$table-prefix}--show-left-shadow) {
26+
.#{$table-prefix}__table-frozen-left {
27+
box-shadow: none;
28+
}
29+
}
30+
31+
&:not(.#{$table-prefix}--show-right-shadow) {
32+
.#{$table-prefix}__table-frozen-right {
33+
box-shadow: none;
34+
}
35+
}
36+
37+
...
38+
}
39+
```
40+
41+
You can write your own styles from scratch or use CSS-in-JS solutions to achieve that
42+
43+
### Custom components
44+
45+
```jsx
46+
<BaseTable
47+
classPrefix="AdvanceTable"
48+
components={{
49+
TableCell: AdvanceTableCell,
50+
TableHeaderCell: AdvanceTableHeaderCell,
51+
ExpandIcon: AdvanceExpandIcon,
52+
SortIndicator: AdvanceSortIndicator,
53+
}}
54+
...
55+
/>
56+
```
57+
58+
### Custom renderers & props
59+
60+
There are a lot of highly flexible props like `xxxRenderer` and `xxxProps` for you to build your own table component, please check the [api](https://autodesk.github.io/react-base-table/api) and [examples](https://autodesk.github.io/react-base-table/examples) for more details

website/siteConfig.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ module.exports = {
44
title: 'Get Started',
55
path: '/docs/get-started',
66
},
7+
{
8+
title: 'Advance',
9+
path: '/docs/advance',
10+
},
711
{
812
title: 'Glossary',
913
path: '/docs/glossary',

0 commit comments

Comments
 (0)