Card
A container for grouping related content with optional header and footer.
Import
import { Card } from '@oztix/roadie-components/card'
Examples
Default
Emphasis
Intents
With image
The subtler card has padding around the image, giving it inset rounded corners. The normal card uses a full-bleed image with overflow-hidden.
Card.Image is an Image. Pass width (and height) to serve a right-sized WebP instead of the original, sizes so the fluid card loads small files on small screens, and placeholder='blur' for a blur-up while it loads.
Composition
Use Card.Header, Card.Content, and Card.Footer to structure content.
API reference
Card
Pass `render={<button onClick=… />}` for a clickable card, or `render={<MyLink href='/x' />}` for a custom link wrapper. The `render` prop accepts an element, a component, or a function `(defaultProps) => element` for full control.
Deprecated: Use `render` instead. `as` will be removed in v3.0.0.
Pass an href to render the card as a routed anchor. Internal hrefs route through the configured `RoadieLinkProvider`; external hrefs (`http(s)://`, `//…`) render `<a target='_blank' rel='noopener noreferrer'>`; `mailto:` / `tel:` / `sms:` render plain `<a>`. Use `external` to override the auto classification. `render` always wins over `href` smart-routing — pass `render` to render a non-anchor or to bypass provider routing.
Force external-link treatment when `href` is set. Has no effect when `render` is set — the consumer's element is responsible for its own target/rel.
Override the auto `target='_blank'` default on external hrefs.
Override the auto `rel='noopener noreferrer'` default on external hrefs.
Escape hatch — swap the underlying element with full control over the rendered shape. See [Linking](/foundations/linking) for the full reference.
Card.Content
No additional props — forwards all standard HTML attributes to the underlying element.
Card.Description
No additional props — forwards all standard HTML attributes to the underlying element.
Card.Footer
No additional props — forwards all standard HTML attributes to the underlying element.
Card.Header
No additional props — forwards all standard HTML attributes to the underlying element.
Card.Image
Image URL. Oztix-CDN hosts get the resize/transcode rewrite; everything else passes through.
Alt text describing the image. Required.
1x render width in CSS pixels. Drives the default `srcSet`/`sizes` and reserves layout. Omit to render a plain pass-through `<img>`.
Target/intrinsic height. Reserves layout (via `aspect-ratio`) and, when set alongside `width`, is sent to the proxy so it crops to both dimensions.
Explicit srcSet ladder. Defaults to `[width, width * 2]`.
`<img sizes>` describing how wide the image renders (e.g. `'100vw'`). Set it for fluid images so Roadie builds a responsive ladder and small screens load small files. Defaults to `${width}px` (fixed size).
Marks the image as LCP-critical: eager loading + `fetchpriority="high"`.
Output format. Defaults to `webp`.
Encoder quality, 1–100. Lower trades fidelity for bytes.
Crop surrounding transparent space server-side (ImageSharp `autotrim=1`). Useful for logos padded with transparency. Takes effect with `width`.
Escape hatch for any other ImageSharp.Web command (`rmode`, `ranchor`, `bgcolor`, etc.), merged verbatim. Takes effect with `width`.
Blur-up placeholder: show a tiny low-quality preview, then fade the full image in on load. `'blur'` wraps the image in a positioned element. The preview is derived from the Oztix proxy by default; pass `blurDataURL` for non-Oztix images or to override.
Explicit preview source for `placeholder='blur'`. Required for non-Oztix images.
Art direction: render a `<picture>` with a `<source>` per breakpoint, each able to use a different URL/crop. The component `src` stays the fallback `<img>`. Each entry inherits `format`/`quality`/`autotrim`/`params`/`width` unless it overrides them.
Defer loading until the image nears the viewport via IntersectionObserver. Use inside horizontally-scrolled surfaces (e.g. Carousel) where native `loading='lazy'` over-fetches. Ignored when `priority` is set.
Card.Title
No additional props — forwards all standard HTML attributes to the underlying element.