Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ekateriinal/lit-simple-table

Simple dynamic table component build with Lit.js
https://github.com/ekateriinal/lit-simple-table

dynamic-table lit-component lit-html table-component table-web-component web-components

Last synced: about 1 month ago
JSON representation

Simple dynamic table component build with Lit.js

Awesome Lists containing this project

README

        

# Simple table component build with Lit

**View Lit Playground:** **[redirect to the playground](https://tinyurl.com/mw6kjdb2)**
---

This repository contains a set of Lit.js components to create accessible and customizable tables. The components included are:

- ``: The main table component that wraps headers and rows.
- ``: The cell component used for both headers and body cells.
- ``: The row component that wraps cells within a table row.

## Components

### ``

A wrapper component for table headers and rows.

**Default slot:**

- `table-cell` and `table-row` components to be used inside.

#### Example:

```html

Header 1
Header 2
Header 3

Data 1
Data 2
Data 3


Data 4
Data 5
Data 6

```

### ``

A cell component for table headers and body cells.

**Properties:**

| Property | Type | Description | Possible Values |
|----------|--------|-----------------------------------------------------|----------------------------------------------|
| `type` | String | Defines the type of the cell. | `'title'`: Used for header cells. |
| | | | `'body'`: Used for regular body cells (default). |
| | | | `'strong'`: Used for bold text in body cells. |

**Example:**

```html
Header 1
Data 1
Strong Data
```

### ``
A wrapper component for table rows. It acts as a wrapper for elements without breaking accessibility and table relationships.

**Example:**
```html

Data 1
Data 2
Data 3

```
This repository was built with the help of the [lit-starter-ts](https://github.com/lit/lit-element-starter-ts) repo.