Have ideas to improve npm?Join in the discussion! »

    svelte-accessible-table
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    svelte-accessible-table

    NPM Build

    Accessible table component for Svelte.

    Install

    yarn add -D svelte-accessible-table
    # OR
    npm i -D svelte-accessible-table

    Usage

    <script>
      import {
        TableContainer,
        TableBody,
        TableHead,
        TableRow,
        TableCell,
      } from "svelte-accessible-table";
    </script>
    
    <TableContainer caption="Influential historical documents">
      <TableHead>
        <TableRow>
          <TableCell>Document title</TableCell>
          <TableCell>Description</TableCell>
          <TableCell>Year</TableCell>
        </TableRow>
      </TableHead>
      <TableBody>
        <TableRow>
          <TableCell>Declaration of Independence</TableCell>
          <TableCell>
            Statement adopted by the Continental Congress declaring independence
            from the British Empire
          </TableCell>
          <TableCell tabular>1776</TableCell>
        </TableRow>
        <TableRow>
          <TableCell>Bill of Rights</TableCell>
          <TableCell>
            Document containing the first ten amendments to the United States
            Constitution
          </TableCell>
          <TableCell tabular>1791</TableCell>
        </TableRow>
        <TableRow>
          <TableCell>Declaration of Sentiments</TableCell>
          <TableCell>
            A document written during the Seneca Falls Convention outlining the
            rights that American women should be entitled to as citizens
          </TableCell>
          <TableCell tabular>1848</TableCell>
        </TableRow>
      </TableBody>
    </TableContainer>

    API

    TableContainer

    Property name Value
    caption string or slot:name (default: undefined)
    zebra boolean (default: false)

    TableCell

    Property name Value
    tabular boolean (default: false)

    Forwarded events

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

    • on:click
    • on:mouseenter
    • on:mouseout

    TypeScript support

    Svelte version 3.31 or greater is required to use this module with TypeScript.

    Changelog

    License

    MIT

    Install

    npm i svelte-accessible-table

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    91.2 kB

    Total Files

    22

    Last publish

    Collaborators

    • avatar