Table

Display structured tabular data with headers and cell content.

Table

Default

Create a table simply with the s-table component and itss-tr, s-td,s-th components.

This component has a different logic for better data management and freer customization according to needs.

Code copied

Striped

You can easily strip the table with the striped property

Code copied

Color

Change the color of a tr by adding the color property to the component s-tr

Code copied

Pagination

You can add the pagination functionality for the table using the #footer slot and the s-pagination component

To make the development easier you can use the Sax Design function that generates the items (getPage) based on the page and also the one that generates the total number of pages in the pagination component (getLength)

This way of handling data is to improve the freedom of customization without losing the ease of implementation

See the example

Code copied

Single Selected

You can add the select functionality with a v-model in the table and the is-selected property

TIP

Using the data property in the tr is important as that is the data to be added to the v-model

Code copied

Multiple Selected

You can do multiple select functionality in the table with the v-model property with its value being an array

for this functionality you can use for example the Sax Design checkboxes and the function toggleSelectAll in the checkbox of th

Code copied

Expandable data

To add a tr that can display expanded data use the#expand slot inside the s-tr component.

Code copied

Edit data

You can edit the data inside the table easily using the s-dialog component and the magic of vuejs

Code copied

Sort

Sort functionality is independent and you can use the global function sortData

TIP

The sortData function needs 4 parameters: the event, the data of the table, the number of items to be ordered, and the sort type

Copied
/**
 * return array was sorted
 */
declare function sortData<T extends Record<string, unknown>>(
  event: Event,
  arr: T[],
  sortKey: keyof T,
  sortType?: 'desc' | 'esc'
): T[]
Code copied

Miscellaneous

This is a sample of everything united and its functionality together

Code copied

Functions

We create this component with a different logic and maybe something not very common as a first point we want development to be more free and for the programmer to have many options and customization based on what he needs and wants to create, for example a very important theme it is the queries of the data in the server and that now they are not manipulated by the component until you yourself using a Sax Design function impose it

So now we use functions that you can use if you need them such as:

toggleSelectAll

See the Example:

Copied
/**
 * return empty array if all items are in selected, otherwise return originalData
 *
 * @param selected Array
 * @param originalData Array
 *
 * @returns Array
 */
declare function toggleSelectAll<T = any>(selected: T[], originalData: T[]): T[]

sortData

See the Example:

Copied
/**
 * return array was sorted
 */
declare function sortData<T extends Record<string, unknown>>(
  event: Event,
  arr: T[],
  sortKey: keyof T,
  sortType?: 'desc' | 'esc'
): T[]

API

PROPS

PropertyTypeValuesDescriptiondefaultExampleMore
loadingBooleantrue | falseDisplay a loading state over table content.
v-modelObject, ArrayObjectArrayDetermines the table values ​​that are selected.
stripedBooleantruefalseAdd stripes to the gray tr.
s-tr:dataObjectObjectwhen the functionality of selected is needed this property is needed since it is the object that is passed to the v-model.
s-tr:is-selectedBooleantruefalseDetermines if the component is in the selected state, for optimize perf
s-td:editBooleantruefalseDetermine if the element is editable by adding underline and the pointer cursor.
s-th:sortBooleantruefalseAdd the sort arrows to the corresponding th.
s-tr:colorString, Theme colorscolorSax Design colorsChange the color of the tr.
No matching data

SLOTS

PropertyTypeValuesDescriptiondefaultExampleMore
headerslotSpace to put an element at the top of the table such as the input search.
Usage
theadslotSpace representing thead element of the table where the `s-th` components will be placed.
Usage
tbodyslotRepresents the tbody element in the table and here we will put the `s-tr` components.
Usage
s-tr:#expandslotRepresents the interior of the tr when it is expanded.
notFoundslotChange the item to display when there are no items in the table.
Usage
No matching data
Last Updated: 2026-08-17, 08:33:54