The shared card for dashboards: a label, a number or a sentence, and a body.
import { DataCard } from '@oztix/roadie-components/data-card'
Put at most one visible action first and DataCard.MoreButton last. More passes its props and ref through, so pass it to a Menu trigger's render to open the card's menu.
value and delta for one headline number, or takeaway for a sentence. Never both. StatTile, table cards and chart cards all build on this rule.source. It sits under a hairline in the footer.actions for what a person can do from the card: at most one visible action, then DataCard.MoreButton for the rest. Actions show in every state, so a refresh still works on a card that failed to load. See card actions.title attribute. It isn't a landmark, so a dashboard can repeat a label such as "Tickets sold" across sections without repeating landmark names.state='loading' sets aria-busy, so assistive tech knows the card isn't ready.Fixed name for the card. People and agents refer to the card by it.
Defaults to 'number'.
One sentence, used when there is no single headline number.
Controls at the top right, after the label. Shown in every state, so an action such as refresh still works on a card that failed to load.
Defaults to ready.
Defaults to We don't have data for this yet. You'll see it here once it arrives..
Body height while loading, such as the plot height.
Inherited from HTMLAttributes
Override the auto `rel='noopener noreferrer'` default on external hrefs.
The More button at the end of a card's actions. It spreads every other prop and the ref onto the button, so it can be a menu trigger's `render`. As a `Menu.Trigger` render, its `data-slot` becomes the trigger's.
CSS class applied to the element, or a function that returns a class based on the component's state.
Pass a URL to render the button as a routed anchor instead of a `<button>`. Internal hrefs route through the configured `RoadieLinkProvider` (or fall back to plain `<a>`); external hrefs (`http(s)://`, `//…`) render as `<a target='_blank' rel='noopener noreferrer'>`; `mailto:` / `tel:` / `sms:` render as plain `<a>`. Pair with `external`, `target`, or `rel` to override the defaults.
Force external-link treatment regardless of `href` shape. Useful for first-party URLs that should still open in a new tab, or for an `https://` URL that should route internally through the provider.
Override the auto `target='_blank'` default on external hrefs.
Download the `href` instead of navigating, optionally as this filename.
The card's label. The button is named "More actions for {label}".
Inherited from HTMLAttributes
Override the auto `rel='noopener noreferrer'` default on external hrefs.
Inherited from ButtonProps
Whether the button should be focusable when disabled.
Defaults to false.
Inherited from NativeButtonProps
Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).
Defaults to true.