Data
TwSpreadsheet
TwSpreadsheet is a Blazor spreadsheet in the manner of Excel, with formulas, formatting, frozen panes, zoom, several sheets and export to Excel or CSV.
Last updated
Please be aware this component is new, may have bugs and/or be subject to change. Please report any bugs at
https://github.com/twblazor/twblazor/issues.
Basic usage
Pass the workbook as
Sheets: a list of Sheet, each holding its cells by address, such as A1. The grid shows columns A to Z and rows 1 to 100 unless you set Columns and Rows. Click a cell or move with the arrow keys, then type to replace it, or press Enter or F2 to edit it. A value starting with = is a formula. The spreadsheet edits the cells in place and reports each change through OnCellsChange, so the workbook can be saved as it changes.| Select all | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Item | Monthly | Yearly | |||||||||||||||||||||||
| 2 | Rent | ¤1,200.00 | ¤14,400.00 | |||||||||||||||||||||||
| 3 | Groceries | ¤350.00 | ¤4,200.00 | |||||||||||||||||||||||
| 4 | Transport | ¤120.00 | ¤1,440.00 | |||||||||||||||||||||||
| 5 | Total | ¤1,670.00 | ¤20,040.00 | |||||||||||||||||||||||
| 6 | ||||||||||||||||||||||||||
| 7 | ||||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||||
| 11 | ||||||||||||||||||||||||||
| 12 | ||||||||||||||||||||||||||
| 13 | ||||||||||||||||||||||||||
| 14 | ||||||||||||||||||||||||||
| 15 | ||||||||||||||||||||||||||
| 16 | ||||||||||||||||||||||||||
| 17 | ||||||||||||||||||||||||||
| 18 | ||||||||||||||||||||||||||
| 19 | ||||||||||||||||||||||||||
| 20 | ||||||||||||||||||||||||||
| 21 | ||||||||||||||||||||||||||
| 22 | ||||||||||||||||||||||||||
| 23 | ||||||||||||||||||||||||||
| 24 | ||||||||||||||||||||||||||
| 25 | ||||||||||||||||||||||||||
| 26 | ||||||||||||||||||||||||||
| 27 | ||||||||||||||||||||||||||
| 28 | ||||||||||||||||||||||||||
| 29 | ||||||||||||||||||||||||||
| 30 | ||||||||||||||||||||||||||
| 31 | ||||||||||||||||||||||||||
| 32 | ||||||||||||||||||||||||||
| 33 | ||||||||||||||||||||||||||
| 34 | ||||||||||||||||||||||||||
| 35 | ||||||||||||||||||||||||||
| 36 | ||||||||||||||||||||||||||
| 37 | ||||||||||||||||||||||||||
| 38 | ||||||||||||||||||||||||||
| 39 | ||||||||||||||||||||||||||
| 40 | ||||||||||||||||||||||||||
| 41 | ||||||||||||||||||||||||||
| 42 | ||||||||||||||||||||||||||
| 43 | ||||||||||||||||||||||||||
| 44 | ||||||||||||||||||||||||||
| 45 | ||||||||||||||||||||||||||
| 46 | ||||||||||||||||||||||||||
| 47 | ||||||||||||||||||||||||||
| 48 | ||||||||||||||||||||||||||
| 49 | ||||||||||||||||||||||||||
| 50 | ||||||||||||||||||||||||||
| 51 | ||||||||||||||||||||||||||
| 52 | ||||||||||||||||||||||||||
| 53 | ||||||||||||||||||||||||||
| 54 | ||||||||||||||||||||||||||
| 55 | ||||||||||||||||||||||||||
| 56 | ||||||||||||||||||||||||||
| 57 | ||||||||||||||||||||||||||
| 58 | ||||||||||||||||||||||||||
| 59 | ||||||||||||||||||||||||||
| 60 | ||||||||||||||||||||||||||
| 61 | ||||||||||||||||||||||||||
| 62 | ||||||||||||||||||||||||||
| 63 | ||||||||||||||||||||||||||
| 64 | ||||||||||||||||||||||||||
| 65 | ||||||||||||||||||||||||||
| 66 | ||||||||||||||||||||||||||
| 67 | ||||||||||||||||||||||||||
| 68 | ||||||||||||||||||||||||||
| 69 | ||||||||||||||||||||||||||
| 70 | ||||||||||||||||||||||||||
| 71 | ||||||||||||||||||||||||||
| 72 | ||||||||||||||||||||||||||
| 73 | ||||||||||||||||||||||||||
| 74 | ||||||||||||||||||||||||||
| 75 | ||||||||||||||||||||||||||
| 76 | ||||||||||||||||||||||||||
| 77 | ||||||||||||||||||||||||||
| 78 | ||||||||||||||||||||||||||
| 79 | ||||||||||||||||||||||||||
| 80 | ||||||||||||||||||||||||||
| 81 | ||||||||||||||||||||||||||
| 82 | ||||||||||||||||||||||||||
| 83 | ||||||||||||||||||||||||||
| 84 | ||||||||||||||||||||||||||
| 85 | ||||||||||||||||||||||||||
| 86 | ||||||||||||||||||||||||||
| 87 | ||||||||||||||||||||||||||
| 88 | ||||||||||||||||||||||||||
| 89 | ||||||||||||||||||||||||||
| 90 | ||||||||||||||||||||||||||
| 91 | ||||||||||||||||||||||||||
| 92 | ||||||||||||||||||||||||||
| 93 | ||||||||||||||||||||||||||
| 94 | ||||||||||||||||||||||||||
| 95 | ||||||||||||||||||||||||||
| 96 | ||||||||||||||||||||||||||
| 97 | ||||||||||||||||||||||||||
| 98 | ||||||||||||||||||||||||||
| 99 | ||||||||||||||||||||||||||
| 100 |
Last change: none yet
Formulas
Formulas use the operators
+ - * / ^ & % and the comparisons = <> < > <= >=, refer to cells as B3 and ranges as B3:B8, and fix a reference with $ as in $B$1. The functions are SUM, AVERAGE, MIN, MAX, COUNT, COUNTA, COUNTIF, SUMIF, PRODUCT, IF, IFERROR, AND, OR, NOT, ROUND, ROUNDUP, ROUNDDOWN, ABS, INT, SQRT, POWER, MOD, PI, LEN, UPPER, LOWER, TRIM, LEFT, RIGHT, MID, CONCAT and NA. While typing a formula, click a cell, or drag across a range, to put its reference in. A problem shows as an error code, such as #DIV/0!, or #CIRC! for a formula that depends on itself.| Select all | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Student | Test 1 | Test 2 | Average | Result | |
| 2 | Ada | 92 | 88 | 90 | Pass | |
| 3 | Grace | 79 | 95 | 87 | Pass | |
| 4 | Alan | 54 | 61 | 57.5 | Retake | |
| 5 | Linus | 47 | 52 | 49.5 | Retake | |
| 6 | ||||||
| 7 | Class average | 71.00 | ||||
| 8 | Pass mark | 60 | ||||
| 9 | Passed | 2 | ||||
| 10 | Top student | Ada | ||||
| 11 | ||||||
| 12 | ||||||
| 13 | ||||||
| 14 |
Several sheets
Each
Sheet gets a tab under the grid. The + button adds a sheet, double-clicking a tab or pressing F2 on it renames it, and the arrow keys move between tabs. A formula refers to another sheet by name, as in =Q1!B5, or with quotes around a name with spaces, as in ='Q1 sales'!B5. Renaming a sheet changes the formulas that refer to it. The ⋯ button after the tabs, or a right-click (a long press on a touch screen) on a tab, opens the sheet menu: rename, move left or right, and delete. Deleting asks first, and can be undone with Ctrl + Z. Bind ActiveSheetIndex to know or set which sheet is shown, and set AllowAddSheet to false to hide the button.| Select all | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Region | Sales | |||
| 2 | North | 12400 | |||
| 3 | South | 9800 | |||
| 4 | West | 15100 | |||
| 5 | Total | 37300 | |||
| 6 | |||||
| 7 | |||||
| 8 | |||||
| 9 | |||||
| 10 | |||||
| 11 | |||||
| 12 |
Showing sheet 1 of 3: Q1
Formatting
The toolbar makes the selected cells bold, italic or underlined, lines them up, and picks a number format:
General, Number with two decimal places, Currency or Percent. Numbers are shown in the app's culture. Set the same from code with SheetCell's Bold, Italic, Underline, Alignment and Format. Undo and redo cover formatting as well as values.| Select all | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Invoice 1042 | ||||
| 2 | |||||
| 3 | Item | Quantity | Price | Amount | |
| 4 | Design | 12 | ¤85.00 | ¤1,020.00 | |
| 5 | Development | 30 | ¤95.00 | ¤2,850.00 | |
| 6 | Hosting | 1 | ¤240.00 | ¤240.00 | |
| 7 | |||||
| 8 | Subtotal | ¤4,110.00 | |||
| 9 | VAT | 20.00% | |||
| 10 | Total | ¤4,932.00 | |||
| 11 | |||||
| 12 |
Fonts and colors
The toolbar sets the font and the text size of the selected cells, colors their text and shades them.
Fonts lists the fonts to offer (Arial, Calibri, Cambria, Courier New, Georgia, Segoe UI, Times New Roman and Verdana by default), FontSizes the sizes in points, and TextColors and FillColors the colors, each a SpreadsheetColor with the name the menu shows and screen readers read out. A filled cell without its own text color gets black or white text, whichever reads better on the fill. From code, set the FontFamily, FontSize, Color and Background of a SheetCell; colors are hex, such as #FEF3C7.| Select all | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Team schedule | |||||
| 2 | ||||||
| 3 | Day | Owner | Status | |||
| 4 | Monday | Ada | Done | |||
| 5 | Tuesday | Grace | Late | |||
| 6 | Wednesday | Alan | Planned | |||
| 7 | ||||||
| 8 | Code names use Courier New | |||||
| 9 | ||||||
| 10 |
Freeze panes, column widths and row heights
The snowflake menu freezes the rows above and the columns before the active cell, or just the top row or first column, so headings stay in view as the sheet scrolls. Set
FrozenRows and FrozenColumns on a Sheet, or call FreezePanes. Drag the edge of a column heading or the bottom edge of a row number to resize it, by mouse or by finger, or double-click the edge to fit it to its contents, or use Widen column, Narrow column, Increase row height, Decrease row height and the two Fit to contents items from the context menu with the keyboard. A row also grows when its cells get a larger text size. Sizes are kept per sheet in ColumnWidths, keyed by the column letters, and RowHeights, keyed by the row number, or set with SetColumnWidth and SetRowHeight. Frozen panes, widths and heights are kept in the Excel export.| Select all | A | B | C | D | E | F | G | H | I | J | K | L | M | N |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Store | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | |
| 2 | Store 01 | 137 | 190 | 243 | 296 | 349 | 402 | 455 | 508 | 561 | 614 | 667 | 720 | |
| 3 | Store 02 | 174 | 227 | 280 | 333 | 386 | 439 | 492 | 545 | 598 | 651 | 704 | 757 | |
| 4 | Store 03 | 211 | 264 | 317 | 370 | 423 | 476 | 529 | 582 | 635 | 688 | 741 | 794 | |
| 5 | Store 04 | 248 | 301 | 354 | 407 | 460 | 513 | 566 | 619 | 672 | 725 | 778 | 831 | |
| 6 | Store 05 | 285 | 338 | 391 | 444 | 497 | 550 | 603 | 656 | 709 | 762 | 815 | 868 | |
| 7 | Store 06 | 322 | 375 | 428 | 481 | 534 | 587 | 640 | 693 | 746 | 799 | 852 | 905 | |
| 8 | Store 07 | 359 | 412 | 465 | 518 | 571 | 624 | 677 | 730 | 783 | 836 | 889 | 942 | |
| 9 | Store 08 | 396 | 449 | 502 | 555 | 608 | 661 | 714 | 767 | 820 | 873 | 926 | 979 | |
| 10 | Store 09 | 433 | 486 | 539 | 592 | 645 | 698 | 751 | 804 | 857 | 910 | 963 | 116 | |
| 11 | Store 10 | 470 | 523 | 576 | 629 | 682 | 735 | 788 | 841 | 894 | 947 | 100 | 153 | |
| 12 | Store 11 | 507 | 560 | 613 | 666 | 719 | 772 | 825 | 878 | 931 | 984 | 137 | 190 | |
| 13 | Store 12 | 544 | 597 | 650 | 703 | 756 | 809 | 862 | 915 | 968 | 121 | 174 | 227 | |
| 14 | Store 13 | 581 | 634 | 687 | 740 | 793 | 846 | 899 | 952 | 105 | 158 | 211 | 264 | |
| 15 | Store 14 | 618 | 671 | 724 | 777 | 830 | 883 | 936 | 989 | 142 | 195 | 248 | 301 | |
| 16 | Store 15 | 655 | 708 | 761 | 814 | 867 | 920 | 973 | 126 | 179 | 232 | 285 | 338 | |
| 17 | Store 16 | 692 | 745 | 798 | 851 | 904 | 957 | 110 | 163 | 216 | 269 | 322 | 375 | |
| 18 | Store 17 | 729 | 782 | 835 | 888 | 941 | 994 | 147 | 200 | 253 | 306 | 359 | 412 | |
| 19 | Store 18 | 766 | 819 | 872 | 925 | 978 | 131 | 184 | 237 | 290 | 343 | 396 | 449 | |
| 20 | Store 19 | 803 | 856 | 909 | 962 | 115 | 168 | 221 | 274 | 327 | 380 | 433 | 486 | |
| 21 | Store 20 | 840 | 893 | 946 | 999 | 152 | 205 | 258 | 311 | 364 | 417 | 470 | 523 | |
| 22 | Store 21 | 877 | 930 | 983 | 136 | 189 | 242 | 295 | 348 | 401 | 454 | 507 | 560 | |
| 23 | Store 22 | 914 | 967 | 120 | 173 | 226 | 279 | 332 | 385 | 438 | 491 | 544 | 597 | |
| 24 | Store 23 | 951 | 104 | 157 | 210 | 263 | 316 | 369 | 422 | 475 | 528 | 581 | 634 | |
| 25 | Store 24 | 988 | 141 | 194 | 247 | 300 | 353 | 406 | 459 | 512 | 565 | 618 | 671 | |
| 26 | Store 25 | 125 | 178 | 231 | 284 | 337 | 390 | 443 | 496 | 549 | 602 | 655 | 708 | |
| 27 | Store 26 | 162 | 215 | 268 | 321 | 374 | 427 | 480 | 533 | 586 | 639 | 692 | 745 | |
| 28 | Store 27 | 199 | 252 | 305 | 358 | 411 | 464 | 517 | 570 | 623 | 676 | 729 | 782 | |
| 29 | Store 28 | 236 | 289 | 342 | 395 | 448 | 501 | 554 | 607 | 660 | 713 | 766 | 819 | |
| 30 | Store 29 | 273 | 326 | 379 | 432 | 485 | 538 | 591 | 644 | 697 | 750 | 803 | 856 | |
| 31 | Store 30 | 310 | 363 | 416 | 469 | 522 | 575 | 628 | 681 | 734 | 787 | 840 | 893 | |
| 32 | ||||||||||||||
| 33 | ||||||||||||||
| 34 | ||||||||||||||
| 35 | ||||||||||||||
| 36 | ||||||||||||||
| 37 | ||||||||||||||
| 38 | ||||||||||||||
| 39 | ||||||||||||||
| 40 |
Tables and filters
Select a range and press the table button on the toolbar, or pick Insert table from the context menu. The dialog shows the range and a My table has headers checkbox; without headers, a row named
Column1, Column2 and so on is inserted above the data. A table has a heading row, banded rows and a filter button on each heading, also opened with Alt + Arrow Down on a heading. The filter sorts the column, offers the same conditions as a TwDataTable column filter, such as is greater than 100 or contains, and lists the column values with a checkbox each. Filtered columns show a filled funnel, and the number of rows shown is announced. FilterOperators chooses the comparisons offered, and ShowFilterConditions and ShowFilterValues turn either part off. From code, add a SheetTable to Sheet.Tables, with Conditions holding a ColumnFilter per column and Filters listing the values to keep, or call AddTableAsync and RemoveTable. The conditions editor is also its own component, TwColumnFilterEditor. In the Excel export, a table is saved as its cells.| Select all | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Order | Customer | Status | Total | ||
| 2 | 1001 | Ada | Shipped | ¤120.00 | ||
| 3 | 1002 | Grace | Pending | ¤80.00 | ||
| 4 | 1003 | Alan | Delivered | ¤45.00 | ||
| 5 | 1004 | Linus | Cancelled | ¤60.00 | ||
| 6 | 1005 | Ada | Delivered | ¤210.00 | ||
| 7 | 1006 | Margaret | Shipped | ¤95.00 | ||
| 8 | 1007 | Grace | Pending | ¤150.00 | ||
| 9 | 1008 | Alan | Shipped | ¤30.00 | ||
| 10 | ||||||
| 11 | Total | ¤790.00 | ||||
| 12 | ||||||
| 13 | ||||||
| 14 |
Zoom and the status bar
The status bar under the grid shows the sum, average and count of the selected cells, and holds the zoom controls: the minus and plus buttons step between 50% and 200%, and the percentage resets to 100%. Bind
Zoom to set or save the level (25% to 400%), or set ShowStatusBar to false to hide the bar.| Select all | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Student | Test 1 | Test 2 | Average | Result | |
| 2 | Ada | 92 | 88 | 90 | Pass | |
| 3 | Grace | 79 | 95 | 87 | Pass | |
| 4 | Alan | 54 | 61 | 57.5 | Retake | |
| 5 | Linus | 47 | 52 | 49.5 | Retake | |
| 6 | ||||||
| 7 | Class average | 71.00 | ||||
| 8 | Pass mark | 60 | ||||
| 9 | Passed | 2 | ||||
| 10 | Top student | Ada | ||||
| 11 | ||||||
| 12 | ||||||
| 13 | ||||||
| 14 |
Zoom: 100%. Select B2:C5 to see their sum and average.
Full screen
The button at the end of the bottom bar makes the spreadsheet cover the window, which helps on small screens; press it again or
Escape to go back. The page behind stops scrolling meanwhile. Bind FullScreen to open it from your own button or know when it changes, or set AllowFullScreen to false to hide the button. The toolbar stays on one line. When its controls do not fit, it scrolls sideways without a scrollbar and a More tools button (⋯) appears at its end, which shows every control on as many lines as they need.| Select all | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Name | Team | Points | ||
| 2 | Linus | Core | 41 | ||
| 3 | Ada | Docs | 78 | ||
| 4 | Grace | Core | 65 | ||
| 5 | Alan | Tools | 52 | ||
| 6 | |||||
| 7 | Total | 236 | |||
| 8 | |||||
| 9 | |||||
| 10 | |||||
| 11 | |||||
| 12 |
Rows, columns and sorting
Right-click the grid, or press
Shift + F10, for a context menu that cuts, copies and pastes, inserts rows above or below and columns before or after the selection, deletes the selected rows or columns, sorts, and clears contents. Formulas on every sheet follow the cells they refer to, and a formula that loses its cell shows #REF!. Sorting orders the selected rows by the column of the active cell; with a single cell selected, it sorts the block of data from A1, keeping a first row of headings in place. All of it can be undone, and is available from code as InsertRowsAsync, DeleteRowsAsync, InsertColumnsAsync, DeleteColumnsAsync and SortAsync.| Select all | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Name | Team | Points | ||
| 2 | Linus | Core | 41 | ||
| 3 | Ada | Docs | 78 | ||
| 4 | Grace | Core | 65 | ||
| 5 | Alan | Tools | 52 | ||
| 6 | |||||
| 7 | Total | 236 | |||
| 8 | |||||
| 9 | |||||
| 10 | |||||
| 11 | |||||
| 12 |
Export
Set
ExportFormats to add an export menu to the toolbar, and ExportFileName for the saved file's name. An Excel workbook (.xlsx) holds every sheet with its formulas, their results and the cell formatting, and opens in Excel, Google Sheets, Numbers and LibreOffice. CSV holds the results of the sheet being shown. The files are written in .NET with no other package. Call ExportAsync to export from your own button; it also returns the file.| Select all | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Team | Budget | Spent | Used | |
| 2 | Design | ¤8,000.00 | ¤6,150.00 | 76.88% | |
| 3 | Engineering | ¤24,000.00 | ¤25,300.00 | 105.42% | |
| 4 | Marketing | ¤12,000.00 | ¤7,400.00 | 61.67% | |
| 5 | |||||
| 6 | |||||
| 7 | |||||
| 8 | |||||
| 9 | |||||
| 10 | |||||
| 11 | |||||
| 12 |
Exporting on the server
TwSpreadsheetExport holds the same writers as static methods, so stored sheets can be turned into a file on the server, for example to email a report: ToExcel, ToCsv, or Export, which returns the bytes with a file name and media type. Formulas are worked out with the same engine as the component.Press the button.
Methods
Use
@ref to work with the spreadsheet from code: SetCellAsync sets a cell as if it were typed, so it can be undone, GetDisplayText reads what a cell shows, SelectAsync selects a cell or range, and UndoAsync, RedoAsync, AddSheetAsync, RemoveSheetAsync, RenameSheetAsync and FocusAsync do what their names say. After changing Sheets directly, call Refresh so the formulas are worked out again.| Select all | A | B | C | D |
|---|---|---|---|---|
| 1 | Task | Hours | Total | |
| 2 | Research | 6 | 225 | |
| 3 | Build | 14 | 525 | |
| 4 | Review | 6 | 225 | |
| 5 | ||||
| 6 | Rate | 37.5 | ||
| 7 | Total | 975 | ||
| 8 |
Grand total: 975
Size and parts
Rows and Columns set how many are shown (100 and 26 by default), ColumnWidth the width of every column in pixels, and Height the height of the scrolling area. ShowToolbar, ShowFormulaBar, ShowSheetTabs and ShowStatusBar hide each part; the keyboard shortcuts still work without the toolbar.| Select all | A | B | C | D |
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 |
RAZOR
<TwSpreadsheet Rows="6" Columns="4" ColumnWidth="88" Height="12rem" ShowToolbar="false" ShowFormulaBar="false" ShowSheetTabs="false" ShowStatusBar="false" AriaLabel="Scratch pad" />Read only
ReadOnly keeps the cells readable, selectable and copyable, with the grid in the Tab order, but nothing can be changed and sheets cannot be added or renamed. Export still works.| Select all | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Student | Test 1 | Test 2 | Average | Result | |
| 2 | Ada | 92 | 88 | 90 | Pass | |
| 3 | Grace | 79 | 95 | 87 | Pass | |
| 4 | Alan | 54 | 61 | 57.5 | Retake | |
| 5 | Linus | 47 | 52 | 49.5 | Retake | |
| 6 | ||||||
| 7 | Class average | 71.00 | ||||
| 8 | Pass mark | 60 | ||||
| 9 | Passed | 2 | ||||
| 10 | Top student | Ada | ||||
| 11 | ||||||
| 12 | ||||||
| 13 | ||||||
| 14 |
RAZOR
<TwSpreadsheet Sheets="@grades" ReadOnly Rows="14" Columns="6" Height="14rem" ShowSheetTabs="false" />Accessibility
The grid follows the ARIA grid pattern, and everything you can do with a mouse you can also do with the keyboard. Every key is listed in this page's keyboard guide.
Screen readers
- The grid is one Tab stop, named by
AriaLabel("Spreadsheet" by default). - Each cell is read out as the arrow keys move, through
aria-activedescendant. - Selected cells carry
aria-selected, and a selected range is announced. - Copying, pasting, clearing, filtering, zooming, deleting a sheet and exporting are announced too.
- A hint about how to edit a cell is linked to the grid with
aria-describedby.
Keyboard
Tableaves the grid unless a cell is being edited, so focus is never trapped.- The context menu opens with
Shift + F10. It resizes and fits columns and rows, which you can otherwise only do by dragging. - A table filter opens with
Alt + Arrow Downon its heading. - Dialogs keep focus inside them, start on the safe choice and close with
Escape.
Touch
- Tap a cell to select it, and edit it in the formula bar.
- Drag a finger from the active cell, or from inside the selected range, to select a range. Hold the finger near an edge of the grid, or past it, to scroll that way and keep selecting.
- A drag that starts anywhere else scrolls the grid, so the sheet can always be moved around.
- Drag the edge of a column heading or row number to resize it. The edges are wider on a touch screen, so they are easier to catch.
Seeing where you are
- The active cell has a thick outline, which turns to the accent colour while the grid has focus.
- The selected range is tinted, and its row and column headings are highlighted.
- Headings and frozen panes stay in view as the grid scrolls, and never cover the active cell.
- A filtered column shows a filled funnel and says "filtered" in its name.
- The default fills get black or white text, whichever reads better, in light and dark themes.
Controls and language
- The toolbar is a
toolbar. Its buttons say whether their format is on and list their shortcuts. - The More tools button says whether the toolbar is expanded with
aria-expanded, and names the controls it shows witharia-controls. - The cell reference box and the formula bar are labelled fields.
- The sheet tabs are a
tablistthat controls the grid. - All of the spreadsheet's own text is translated into the app's language.
Theme configuration
Styling is controlled by
TwBlazorTheme.Components (a TwSpreadsheetTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Full reference: TwSpreadsheetTheme on the API docs.