Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/metonym/svelte-accessible-table
- Owner: metonym
- License: mit
- Created: 2020-04-17T12:38:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T06:23:38.000Z (over 1 year ago)
- Last Synced: 2024-10-05T15:45:54.600Z (about 1 month ago)
- Topics: a11y, accessible, svelte, svelte-component, table
- Language: Svelte
- Homepage: https://metonym.github.io/svelte-accessible-table/
- Size: 384 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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