How to use the react-styleguidist/lib/client/utils/getUrl function in react-styleguidist

To help you get started, we’ve selected a few react-styleguidist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github quid / refraction / src / components / SectionHeading.js View on Github external
export default function SectionHeading({
  slotName,
  slotProps,
  children,
  id,
  pagePerSection,
  depth,
  ...rest
}) {
  const href = pagePerSection
    ? getUrl({ slug: id, id: rest.depth !== 1, takeHash: true })
    : getUrl({ slug: id, anchor: true });
  return (
    }
      id={id}
      href={href}
      depth={depth === 2 ? 1 : depth}
      {...rest}
    >
      {children}
    
  );
}
github bootstrap-styled / rsg-components / src / ComponentsList / ComponentsList.js View on Github external
const mappedItems = items.map((item) => ({
    ...item,
    href: item.href
      ? item.href
      : getUrl({
        name: item.name,
        slug: item.slug,
        anchor: !useRouterLinks,
        hashPath: useRouterLinks ? hashPath : false,
        id: useRouterLinks ? useHashId : false,
      }),
  }));
  return ;