Usage
Use the Display Wrapper component to show and hide content based on the developer's session status in the Dev Portal (i.e. if the developer is authenticated or unauthenticated).
As an example, you may have a Page Hero encouraging developers to register for an account on your public homepage that you only want to show to unauthenticated developers (meaning once the developer logs in, you do not want to show the content).
::display-wrapper
---
audience: "unauthenticated"
---
:::page-hero
---
background-color: "#000933"
title-font-size: "44px"
title-line-height: "48px"
padding: "60px 40px"
---
#title
Sign up to start building today!
#description
Explore API documentation and OpenAPI specs
#actions
::::button{ size="large" to="#sign-up" }
Create an account
::::
:::
::
Props
audience
In addition to defining a Page or Snippet's visibility property via the Portal Editor or API, you may want more fine-grain control for components and content throughout your Dev Portal.
Use the audience prop to show or hide the MDC content in a Page or Snippet based on the developer's current session status.
- Type:
'all' | 'unauthenticated' | 'authenticated' | 'none'all: Always shownunauthenticated: Shown only to unauthenticated developersauthenticated: Shown only to authenticated developersnone: Never shown
- Default:
'all'
Slots
default
Use the #default slot for the content you want to conditionally show or hide.