CarOffer
A rental car result.
Great value
Compact · Velo C3 or similar
- 5 seats
- 2 bags
- Automatic
- Electric · 380 km
- A/C
- Free cancellation
- Unlimited mileage
Tallow Rent8.6 · ExcellentIn terminal · Merrow Airport
$38 / day$266 total for 7 days
View code
<CarOffer
art={<CarArt />}
category="Compact"
model="Velo C3 or similar"
badges={<Badge color="success" variant="secondary">Great value</Badge>}
specs={[
{ kind: "seats", label: "5 seats" },
{ kind: "bags", label: "2 bags" },
{ kind: "transmission", label: "Automatic" },
{ kind: "electric", label: "Electric · 380 km" },
{ kind: "ac", label: "A/C" },
]}
perks={["Free cancellation", "Unlimited mileage"]}
vendor="Tallow Rent"
rating="8.6 · Excellent"
pickup="In terminal · Merrow Airport"
price="$38"
priceUnit="/ day"
total="$266 total for 7 days"
actions={<Button>View deal</Button>}
/>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { CarOffer } from "@sdxc/ui/travel";Renders the card as an <article> headed by the class and model in a heading at the ambient
level. Under 38rem the picture heads the card and the price closes it; wider, the picture,
the details and the price take three columns. Spec icons are decoration beside their words.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
art | RemixNode | No | The car's picture, such as an <img> or SVG; it fills a 16:10 frame. |
category | RemixNode | Yes | The car class, such as "Compact"; it heads the card. |
model | RemixNode | No | The example model, such as "Velo C3 or similar", after the class. |
level | HeadingLevel | No | The heading level of the class and model; the ambient level, then 3, when left out. |
specs | Spec[] | No | |
perks | RemixNode[] | No | Short benefits, each drawn with a check, such as "Free cancellation". |
vendor | RemixNode | No | The rental company's name, such as "Tallow Rent". |
vendorLogo | RemixNode | No | The rental company's logo, drawn in a 1.5rem-tall box before its name. |
rating | RemixNode | No | The company's rating as shown, such as "8.6 · Excellent", after a star. |
pickup | RemixNode | No | Where the car is collected, such as "In terminal · Merrow Airport". |
badges | RemixNode | No | Labels over the card, such as a <Badge> reading "Great value". |
price | RemixNode | Yes | The daily price, formatted by the caller, such as "$38". |
priceUnit | RemixNode | No | What the price is per, such as "/ day", after it in small type. |
total | RemixNode | No | The total for the rental, such as "$266 total". |
actions | RemixNode | No | The select link or button, under the price. |
Also accepts everything in Omit<TagProps<"article">, "children">.
Types
| Name | Values | What it decides |
|---|---|---|
SpecKind | "seats" | "bags" | "doors" | "transmission" | "fuel" | "electric" | "ac" | "mileage" | What a spec chip states, which picks its icon. |