WRNexus UI
Base component

Card

Group related content in a responsive themed surface with title, description, content, and supporting slots.

41 props3 slots6 outputsTheme readyResponsive
Interactive playground

Configure Card

Change any prop and inspect the server-rendered component immediately.

Live preview

Team workspace

One place for your projects, files, and conversations.

Supporting content belongs inside the default slot.

Component code
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      title="Team workspace"
      description="One place for your projects, files, and conversations."
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}">
      <div data-slot="header">
        <div class="showcase-slot">header slot</div>
      </div>
      <div data-slot="footer">
        <div class="showcase-slot">footer slot</div>
      </div>
    </Card>
  }
}
Event outputInteract with the preview to inspect the typed payload.
Component props41 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Structured content card

Group a title, description, content, and supporting actions.

01
Live preview

Citizen service

Access a trusted online service.

Supporting content belongs inside the default slot.

Component usage.wrn
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      title="Citizen service"
      description="Access a trusted online service."
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}">
      <div data-slot="header">
        <div class="showcase-slot">header slot</div>
      </div>
      <p class="showcase-card-copy">Supporting content belongs inside the default slot.</p>
      <div data-slot="footer">
        <div class="showcase-slot">footer slot</div>
      </div>
    </Card>
  }
}
Compact

Compact dashboard card

Use reduced spacing for metrics, filters, and operational information.

02
Live preview

Open requests

Requests waiting for assignment.

38
Component usage.wrn
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      title="Open requests"
      description="Requests waiting for assignment."
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}"
      size="compact"
      variant="soft">
      <div data-slot="header">
        <div class="showcase-slot">header slot</div>
      </div>
      <strong class="showcase-card-value">38</strong>
      <div data-slot="footer">
        <div class="showcase-slot">footer slot</div>
      </div>
    </Card>
  }
}
Advanced

Featured resource

Keep the description and next action together in a single surface.

03
Live preview

Featured guide

A complete guide to public safety and emergency readiness.

Read guide
Component usage.wrn
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      title="Featured guide"
      description="A complete guide to public safety and emergency readiness."
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}"
      size="lg">
      <div data-slot="header">
        <div class="showcase-slot">header slot</div>
      </div>
      <a href="#guide" class="showcase-action">Read guide</a>
      <div data-slot="footer">
        <div class="showcase-slot">footer slot</div>
      </div>
    </Card>
  }
}
Recommended

Image with footer

A cover image, concise body, and separate footer.

04
Live preview
Green abstract cover

Design your next chapter

A practical guide to building thoughtful products.

Component usage.wrn
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      title="Design your next chapter"
      description="A practical guide to building thoughtful products."
      footer="6 min read"
      imageSrc="/showcase-images/green-hero.svg"
      imageAlt="Green abstract cover"
      actionLabel="Read guide"
      actionHref="#guide"
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}">
      <div data-slot="header">
        <div class="showcase-slot">header slot</div>
      </div>
      <div data-slot="footer">
        <div class="showcase-slot">footer slot</div>
      </div>
    </Card>
  }
}
Compact

Without a header

Body content with an optional footer; no reserved heading space.

05
Live preview

Your workspace is ready. Invite your teammates to get started.

Updated just now
Component usage.wrn
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      description="Your workspace is ready. Invite your teammates to get started."
      footer="Updated just now"
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}">
      <div data-slot="header">
        <div class="showcase-slot">header slot</div>
      </div>
      <div data-slot="footer">
        <div class="showcase-slot">footer slot</div>
      </div>
    </Card>
  }
}
Advanced

Image-only card

A simple image surface without header or footer chrome.

06
Live preview
Blue geometric landscape
Component usage.wrn
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      imageSrc="/showcase-images/blue-mountain.svg"
      imageAlt="Blue geometric landscape"
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}">
      <div data-slot="header">
        <div class="showcase-slot">header slot</div>
      </div>
      <div data-slot="footer">
        <div class="showcase-slot">footer slot</div>
      </div>
    </Card>
  }
}
Advanced

Custom slots

Supply arbitrary header, body, and footer content. Use showHeader and showFooter to hide either region.

07
Live preview
Team invitation
Component usage.wrn
page CardExample {
  state headerActions = []
  state navigation = []
  state items = []
  view {
    <Card
      headerActions="{headerActions}"
      navigation="{navigation}"
      items="{items}">
      <div data-slot="header">
        <strong>Team invitation</strong>
      </div>
      <Input label="Email" placeholder="name@company.com" />
      <div data-slot="footer">
        <Button label="Send invitation" />
      </div>
    </Card>
  }
}
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@clickFires when the interactive surface is activated.
@actionFires when the component's primary or item action is activated.
@navigateFires when the component emits the navigate event.
@dismissFires after the announcement or feedback surface is dismissed.
@loadFires after remote or deferred content loads successfully.
@errorFires when the component cannot complete an operation.
Declarative handlers.wrn
<Card
  @click='console.log(payload)'
  @action='console.log(payload)'
  @navigate='console.log(payload)'
  @dismiss='console.log(payload)'
  @load='console.log(payload)'
  @error='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"Card\"], [data-component=\"Card\"]")

if (component) registerOutputHandler(component, "click", (payload) => {
  console.log("click", payload)
})

if (component) registerOutputHandler(component, "action", (payload) => {
  console.log("action", payload)
})

if (component) registerOutputHandler(component, "navigate", (payload) => {
  console.log("navigate", payload)
})

if (component) registerOutputHandler(component, "dismiss", (payload) => {
  console.log("dismiss", payload)
})

if (component) registerOutputHandler(component, "load", (payload) => {
  console.log("load", payload)
})

if (component) registerOutputHandler(component, "error", (payload) => {
  console.log("error", payload)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
titlestring""No
iconstring""No
titleKeystring""No
subtitlestring""No
subtitleKeystring""No
descriptionstring""No
descriptionKeystring""No
showHeaderbooleantrueNo
showFooterbooleantrueNo
headerstring""No
footerstring""No
imageSrcstring""No
imageAltstring""No
imagePositionstring"top"No
actionLabelstring""No
actionLabelKeystring""No
actionHrefstring""No
headerActionsunknown[][]No
navigationunknown[][]No
activeNavstring""No
mobileNavigationbooleanfalseNo
alertTitlestring""No
alertDescriptionstring""No
emptybooleanfalseNo
emptyTitlestring"No data to show"No
emptyIconstring"icon-[lucide--inbox]"No
itemsunknown[][]No
sizestring"md"No
colorstring"primary"No
variantstring"default"No
layoutstring"vertical"No
alignstring"left"No
hoverstring"none"No
radiusstring"default"No
shadowstring"default"No
equalHeightbooleanfalseNo
scrollablebooleanfalseNo
maxHeightstring"18rem"No
dismissiblebooleanfalseNo
ariaLabelstring""No
classstring""No