Card
Card groups related content and actions in a bordered section. Use it for dashboards, settings sections and forms. For a plain list row, use Item.
Card Title
Card description goes here.
Card content goes here.
This example also needs: Button.
Installation
Run npx nxds-cli@latest init first if nxds isn’t set up in your app yet. See Install.
Usage
Composition
Examples
With action
Put a header action beside the title with CardAction.
Card with Action
This card has an action button.
Content with an action button in the header.
With footer
Place action buttons at the bottom with CardFooter.
Card with Footer
This card demonstrates footer usage.
The footer is useful for action buttons.
Content only
Use a card with content only, without a header or footer.
A card with only content, no header or footer.
Login card
Wrap a sign-in form in a card with a header and footer.
Props
Card
Card adds no props of its own; it accepts the props of the element or primitive it wraps.
CardAction
CardAction adds no props of its own; it accepts the props of the element or primitive it wraps.
CardContent
CardContent adds no props of its own; it accepts the props of the element or primitive it wraps.
CardDescription
CardDescription adds no props of its own; it accepts the props of the element or primitive it wraps.
CardFooter
CardFooter adds no props of its own; it accepts the props of the element or primitive it wraps.
CardHeader
CardHeader adds no props of its own; it accepts the props of the element or primitive it wraps.
CardTitle
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Applies the title styles to the child element, such as a different heading level. |
Card groups related content and actions in a bordered section. Use it for dashboards, settings sections and forms.
This example also needs: Button.
Installation
Install the following dependencies:
Copy and paste the following code into your project.
components/card/Card.vue components/card/CardAction.vue components/card/CardContent.vue components/card/CardDescription.vue components/card/CardFooter.vue components/card/CardHeader.vue components/card/CardTitle.vue components/card/index.ts Keep each file at the path shown above it.
Paths are relative to
packages/vue/src/. Keep the same folders under your@/root, and the imports between files work without edits.
Usage
Examples
With action
Put a header action beside the title with CardAction.
With footer
Place action buttons at the bottom with CardFooter.
Content only
Use a card with content only, without a header or footer.
Login card
Wrap a sign-in form in a card with a header and footer.
Props
Card
Card adds no props of its own; it accepts the props of the element or primitive it wraps.
CardAction
CardAction adds no props of its own; it accepts the props of the element or primitive it wraps.
CardContent
CardContent adds no props of its own; it accepts the props of the element or primitive it wraps.
CardDescription
CardDescription adds no props of its own; it accepts the props of the element or primitive it wraps.
CardFooter
CardFooter adds no props of its own; it accepts the props of the element or primitive it wraps.
CardHeader
CardHeader adds no props of its own; it accepts the props of the element or primitive it wraps.
CardTitle
CardTitle adds no props of its own; it accepts the props of the element or primitive it wraps.