Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thoughtindustries/catalog

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thoughtindustries/catalog

A base component for catalog

  • 1.2.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@thoughtindustries/catalog

The Catalog allows learners to search and browse for content. It is a central component to any online learning platform.

Import component

import { Catalog, CatalogProvider } from '@thoughtindustries/catalog';

Usage

# CatalogProvider takes a config object to parse URL search params and/or handle custom catalog configurations
# Sample config object
const config = {
  parsedUrl: {
    pathname: '/catalog',
    searchString: '?query=test'
  }
}
# Sample config object with custom catalog configurations
const config = {
  parsedUrl: {
    pathname: '/catalog',
    searchString: '?query=test'
  },
  layoutId: 'layout-id',
  widgetId: 'widget-id'
}

<CatalogProvider config={config}>
  <Catalog onAddedToQueue={(item) => Promise.resolve()} />
</CatalogProvider>

# Or use custom pagination
<CatalogProvider config={config}>
  <Catalog 
    onAddedToQueue={(item) => Promise.resolve()}
    pagination={({page, pageSize, total, getPageLink}) => <>...</>} />
</CatalogProvider>

# Or use custom price formatter
const priceFormat = (priceInCents) => {
  const formatter = new Intl.NumberFormat('en-US', {
      style: 'currency',
      currency: 'USD'
    });
  return formatter.format(priceInCents / 100);
}
<CatalogProvider config={config}>
  <Catalog 
    onAddedToQueue={(item) => Promise.resolve()}
    priceFormat={priceFormat} />
</CatalogProvider>

FAQs

Package last updated on 25 Jan 2023

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