Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/metonym/svelte-accessible-table

Accessible table component for Svelte
https://github.com/metonym/svelte-accessible-table

a11y accessible svelte svelte-component table

Last synced: 26 days ago
JSON representation

Accessible table component for Svelte

Awesome Lists containing this project

README

        

# svelte-accessible-table

[![NPM][npm]][npm-url]

> Accessible Svelte table component.

---

## Installation

**Yarn**

```bash
yarn add -D svelte-accessible-table
```

**NPM**

```bash
npm i -D svelte-accessible-table
```

**pnpm**

```bash
pnpm i -D svelte-accessible-table
```

## Usage

```svelte

import {
TableContainer,
TableBody,
TableHead,
TableRow,
TableCell,
} from "svelte-accessible-table";



Document title
Description
Year




Declaration of Independence

Statement adopted by the Continental Congress declaring independence
from the British Empire

1776


Bill of Rights

Document containing the first ten amendments to the United States
Constitution

1791


Declaration of Sentiments

A document written during the Seneca Falls Convention outlining the
rights that American women should be entitled to as citizens

1848

```

## API

### `TableContainer` props

| Name | Type | Default value |
| :------ | :---------------------- | :------------ |
| caption | `string` or `slot:name` | `undefined` |
| zebra | `boolean` | `false` |

### `TableCell` props

| Name | Type | Default value |
| :------ | :-------- | :------------ |
| tabular | `boolean` | `false` |

### Forwarded events

The following events are forwarded to the `TableHead`, `TableRow` and `TableCell` components.

- on:click
- on:mouseenter
- on:mouseleave

## Changelog

[Changelog](CHANGELOG.md)

## License

[MIT](LICENSE)

[npm]: https://img.shields.io/npm/v/svelte-accessible-table.svg?style=for-the-badge&color=%23ff3e00
[npm-url]: https://npmjs.com/package/svelte-accessible-table