Skip to content

Commit 40d737f

Browse files
committed
Revise sorting docs; add note about clearing sort
1 parent a05a5e2 commit 40d737f

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

vignettes/examples.Rmd

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ reactable(iris)
2626
Columns can be customized by providing a named list of column definitions
2727
created by `colDef()` to `columns`:
2828
```{r}
29-
reactable(iris[1:5, ], columns = list(
30-
Sepal.Length = colDef(name = "Sepal Length"),
31-
Sepal.Width = colDef(name = "Sepal Width"),
32-
Species = colDef(align = "center")
33-
))
29+
reactable(
30+
iris[1:5, ],
31+
columns = list(
32+
Sepal.Length = colDef(name = "Sepal Length"),
33+
Sepal.Width = colDef(name = "Sepal Width"),
34+
Species = colDef(align = "center")
35+
)
36+
)
3437
```
3538

3639
For convenience, you can also specify a default `colDef()` to use for all
@@ -55,12 +58,14 @@ reactable(
5558

5659

5760
## Sorting
58-
Tables are sortable by default. You can sort on a column by clicking on its
59-
header, or sort on multiple columns by holding the shift key while sorting.
61+
Tables are sortable by default. You can sort a column by clicking on its
62+
header, or sort multiple columns by holding down the shift key while sorting.
63+
64+
You can also clear the sort of a column by holding the shift key while sorting.
6065

6166
### Default sort order
6267
Tables are sorted in ascending order first by default. To customize the sort order,
63-
set `defaultSortOrder` on a table or column to either `"asc"` (ascending) or
68+
set `defaultSortOrder` in a table or column to either `"asc"` (ascending) or
6469
`"desc"` (descending):
6570
```{r}
6671
reactable(
@@ -73,7 +78,8 @@ reactable(
7378
```
7479

7580
### Default sorted columns
76-
You can pre-sort columns by specifying a vector of column names in `defaultSorted`:
81+
You can set the default sorted columns by providing a vector of column names
82+
to `defaultSorted`:
7783
```{r}
7884
reactable(iris[48:52, ], defaultSorted = c("Species", "Petal.Length"))
7985
```

0 commit comments

Comments
 (0)