Icons
Defaults
By default, starlight-package-managers
displays a package manager icon next to its name.
import { PackageManagers } from 'starlight-package-managers'
<PackageManagers pkg="astro" />
The code above generates the following commands:
npm i astro
yarn add astro
pnpm add astro
Hiding Icons
You can hide the package manager icon by setting the icons
prop to false
.
import { PackageManagers } from 'starlight-package-managers'
<PackageManagers pkg="astro" icons={false} />
The code above generates the following commands:
npm i astro
yarn add astro
pnpm add astro
Hiding icons globally
Having to specify the icons
prop every time can be tedious.
To avoid this, you can create a custom Astro component wrapping starlight-package-managers
:
---import { PackageManagers, type PackageManagersProps,} from 'starlight-package-managers'
type Props = PackageManagersProps---
{/* Hide the icons. */}<PackageManagers icons={false} {...Astro.props} />
Now you can use the custom component instead of starlight-package-managers
:
import NoIconPackageManagers from '@/components/NoIconPackageManagers.astro'
<NoIconPackageManagers pkg="astro" />
The code above generates the following commands:
npm i astro
yarn add astro
pnpm add astro