Aller au contenu
Ceci est une variante note - idéale pour les informations générales.
Ceci est une variante tip - parfaite pour les bonnes nouvelles !
Ceci est une variante caution - à utiliser pour les avertissements.
Ceci est une variante danger - pour les alertes critiques !

Variants Demo

Ce contenu n’est pas encore disponible dans votre langue.

This page demonstrates all four announcement variants. Look at the top of the page to see each variant in action.

The announcements at the top of this page showcase:

  1. Note (Blue): General information and updates
  2. Tip (Green): Positive news and helpful tips
  3. Caution (Orange): Warnings and deprecation notices
  4. Danger (Red): Critical alerts and breaking changes

These announcements are configured with the showOn option targeting this specific page:

starlightAnnouncement({
displayMode: 'stack',
announcements: [
{
id: 'demo-note',
content: 'This is a <strong>note</strong> variant - great for general information.',
variant: 'note',
showOn: ['/demos/variants/'],
},
{
id: 'demo-tip',
content: 'This is a <strong>tip</strong> variant - perfect for positive news!',
variant: 'tip',
showOn: ['/demos/variants/'],
},
{
id: 'demo-caution',
content: 'This is a <strong>caution</strong> variant - use for warnings.',
variant: 'caution',
showOn: ['/demos/variants/'],
},
{
id: 'demo-danger',
content: 'This is a <strong>danger</strong> variant - for critical alerts!',
variant: 'danger',
showOn: ['/demos/variants/'],
},
],
})

The variants use Starlight’s built-in color variables for consistency with the aside component:

VariantBackgroundBorderUse Case
note--sl-color-blue-low--sl-color-blueInformation, updates
tip--sl-color-green-low--sl-color-greenSuccess, tips
caution--sl-color-orange-low--sl-color-orangeWarnings
danger--sl-color-red-low--sl-color-redCritical alerts
  • Dismiss any announcement by clicking the X button
  • Refresh the page to see dismissed announcements again (after clearing localStorage)

See Announcement Options for detailed documentation on variants.