New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@govuk-frederic/table

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govuk-frederic/table

govuk-frederic: Frederic project specific components.

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by50%
Maintainers
4
Weekly downloads
 
Created
Source

Table

Import

  import Table from '@govuk-frederic/table';

Usage

Simple

const arrayExampleHeadings = ['Heading 1', 'Heading 2', 'Heading 3', 'Heading 4'];
const arrayExampleContent = [
 ['Content 1-1', 'Content 1-2', 'Content 1-3', 'Content 1-4'],
 ['Content 2-1', 'Content 2-2', 'Content 2-3', 'Content 2-4'],
 ['Content 3-1', 'Content 3-2', 'Content 3-3', 'Content 3-4'],
];
const columnTableNames = ['one', 'two', 'three', ['i', 'am', 'named', 'individually']];

<Table titles={arrayExampleHeadings} rows={arrayExampleContent} names={columnTableNames} />

rowIncludesHeading

const arrayExampleHeadings = ['Heading 1', 'Heading 2', 'Heading 3', 'Heading 4'];
const arrayExampleContent = [
 ['Content 1-1', 'Content 1-2', 'Content 1-3', 'Content 1-4'],
 ['Content 2-1', 'Content 2-2', 'Content 2-3', 'Content 2-4'],
 ['Content 3-1', 'Content 3-2', 'Content 3-3', 'Content 3-4'],
];
const rowTableNamesWithTitles = ['heading', 'one', ['i', 'am', 'named', 'individually'], 'three'];

<Table titles={arrayExampleHeadings} rows={arrayExampleContent} rowIncludesHeading nameByRow names={rowTableNamesWithTitles} />

rowIncludesHeading, no titles

const arrayExampleHeadings = ['Heading 1', 'Heading 2', 'Heading 3', 'Heading 4'];
const arrayExampleContent = [
 ['Content 1-1', 'Content 1-2', 'Content 1-3', 'Content 1-4'],
 ['Content 2-1', 'Content 2-2', 'Content 2-3', 'Content 2-4'],
 ['Content 3-1', 'Content 3-2', 'Content 3-3', 'Content 3-4'],
];
const rowTableNames = ['one', ['i', 'am', 'named', 'individually'], 'three'];

<Table rows={arrayExampleContent} rowIncludesHeading nameByRow names={rowTableNames} />

rowIncludesHeading, no titles, small single row

const arrayExampleHeadings = ['Heading 1', 'Heading 2', 'Heading 3', 'Heading 4'];
const arrayExampleContent = [
 ['Content 1-1', 'Content 1-2', 'Content 1-3', 'Content 1-4'],
 ['Content 2-1', 'Content 2-2', 'Content 2-3', 'Content 2-4'],
 ['Content 3-1', 'Content 3-2', 'Content 3-3', 'Content 3-4'],
];
const rowTableNames = ['one', ['i', 'am', 'named', 'individually'], 'three'];

<Table rows={[['title', 'value']]} rowIncludesHeading nameByRow names={rowTableNames} />

rowIncludesHeading, with titles, with flexible columns

const arrayExampleHeadings = ['Heading 1', 'Heading 2', 'Heading 3', 'Heading 4'];
const arrayExampleContent = [
 ['Content 1-1', 'Content 1-2', 'Content 1-3', 'Content 1-4'],
 ['Content 2-1', 'Content 2-2', 'Content 2-3', 'Content 2-4'],
 ['Content 3-1', 'Content 3-2', 'Content 3-3', 'Content 3-4'],
];
const rowTableNamesWithTitles = ['heading', 'one', ['i', 'am', 'named', 'individually'], 'three'];

<Table titles={arrayExampleHeadings} rows={arrayExampleContent} flexibleColumns rowIncludesHeading nameByRow names={rowTableNamesWithTitles} />

Properties

PropRequiredDefaultTypeDescription
flexibleColumnsfalsebool
name``````string
nameByRowfalsebool
names[]arrayOf[object Object]
rowIncludesHeadingfalsebool
rowstrue``````arrayOf[object Object]
titlesnullarrayOf[object Object]

FAQs

Package last updated on 21 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc