npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@visual-framework/vf-table

v1.2.2

Published

vf-table component

Downloads

899

Readme

Table component

npm version

About

Ever useful for presentation of tabular information and data — never to be used for layout.

Usage

The Table component is designed to display tabular data in an organised, accessible manner. It provides styling for features such as selection, sorting, captions and other variants.

The current vf-table is not optimised for mobile or smaller screens.

When to use

  • When displaying structured information in rows and columns for easy comparison across multiple items
  • When handling large volumes of data that require sorting and management.
  • To illustrate relationships and categories within structured data clearly.

When not to use

  • Do not use the vf-table as a visual layout for content on a page
  • Do not use tables to present primarily visual content, such as images or videos, where a visual layout is more appropriate.
  • Avoid tables for multi-level hierarchical information, as they can become cumbersome to navigate.
  • Avoid tables when the context or relationships between data points are not well defined or necessary for understanding the information.

Variants

Default Table:

  • The basic table setup without additional functionalities.

Table with Footer:

  • Includes a footer that can be used for summary information.

Table with Caption:

  • The caption provides a concise summary or overall topic of the table, providing context for users.

Table with Row Headings:

  • Use a different weight to emphasise the identifying information in a row (first column) by adding the class vf-table__heading

Actions:

  • Common actions (e.g., edit, delete) can be shown in rows. Using this styling would allow users to complete tasks directly within a table hence reducing clicks required to perform the action.

Sortable Table:

  • To show tables sorting in a specific order such as alphabetical or numerical, this styling can be used.

Selectable Table:

  • The styling shows row selection for batch actions or further manipulation.

CSS Class Reference

| Class | Applies To | Result | | -------------------- | ---------- | ---------------------------------------------------------------------- | | vf-table | table | Gives initial generic styling to the table element and it's children | | vf-table--striped | vf-table | Adds striped rows to the relevant tr elements. | | vf-table--bordered | vf-table | adds a border around all elements | | vf-table--compact | vf-table | Reduces the padding on the heading and cells | | vf-table--loose | vf-table | Increases the padding on the heading and cells |

Accessibility

Accessibility is critical to ensure all users can interact with the Table component effectively.

  • Use semantic HTML elements like <tr>, <th>, and <td>.
  • Ensure keyboard navigability and screen reader compatibility by using appropriate aria attributes.
  • Maintain high contrast ratios for text and background colours.

Best Practices Recommendations

  • Align text to the left for readability, except for numerical data, which should be right-aligned to facilitate comparison.
  • Ensure interactive elements like links are clearly visible and easily accessible, especially on touch devices.

Install

This repository is distributed with npm. After installing npm, you can install vf-table with this command.

$ yarn add --dev @visual-framework/vf-table

Sass/CSS

The style files included are written in Sass. If you're using a VF-core project, you can import it like this:

@import "@visual-framework/vf-table/index.scss";

Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter

Help