Skip to content

Resources by selector

The ResourcesBySelector component allows you to pull in documentation resources based on the pcx_content_type and products frontmatter properties.

Component

import { ResourcesBySelector } from "~/components";
<ResourcesBySelector
directory="workers/examples/"
types={["example"]}
filterables={["products"]}
/>

Inputs

  • directory string

    The directory to search for resources in, relative to src/content/docs/. For example, for Workers tutorials, directory="workers/tutorials/".

  • filterables string[]

    An array of frontmatter properties to show in the frontend filter dropdown. For example, filterables={["products"]} will allow users to filter based on each pages' products frontmatter.

  • types string[]

    An array of pcx_content_type values to filter which content gets pulled into the component. For example, types={["example"]}.

  • products string[] optional

    An array of products values to filter which content gets pulled into the component. For example, products={["D1"]}.

  • showDescriptions boolean optional (default true)

    If set to false, will only show the titles of associated pages, not the showDescriptions

  • showLastUpdated boolean optional (default false)

    If set to true, will add the last updated date, which is added in the updated frontmatter value.