This page demonstrates the sidebar.customProps frontmatter option which allows you to add custom properties to sidebar items, such as badges.
The sidebar.customProps field accepts an object with arbitrary key-value pairs. Shipyard supports special properties for common use cases:
badge - Text to display in a badge next to the sidebar itembadgeType - Style of the badge (info, success, warning, error, primary, secondary, accent)Add the sidebar.customProps property to your frontmatter:
---
title: My New Feature
sidebar:
customProps:
badge: New
badgeType: success
---
This page uses:
sidebar:
customProps:
badge: New
badgeType: success
Look at the sidebar - you’ll see a green “New” badge next to this page’s entry!
| Type | Description |
|---|---|
info | Blue badge (default) |
success | Green badge |
warning | Yellow/orange badge |
error | Red badge |
primary | Primary theme color |
secondary | Secondary theme color |
accent | Accent theme color |
Custom props are useful for:
You can also add any custom property you need:
sidebar:
customProps:
badge: Beta
badgeType: warning
version: "2.0"
experimental: true
Custom properties beyond badge and badgeType are available in the sidebar entry for custom rendering components.