SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

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
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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.

PropTypeRequiredDescription
artRemixNodeNoThe car's picture, such as an <img> or SVG; it fills a 16:10 frame.
categoryRemixNodeYesThe car class, such as "Compact"; it heads the card.
modelRemixNodeNoThe example model, such as "Velo C3 or similar", after the class.
levelHeadingLevelNoThe heading level of the class and model; the ambient level, then 3, when left out.
specsSpec[]No
perksRemixNode[]NoShort benefits, each drawn with a check, such as "Free cancellation".
vendorRemixNodeNoThe rental company's name, such as "Tallow Rent".
vendorLogoRemixNodeNoThe rental company's logo, drawn in a 1.5rem-tall box before its name.
ratingRemixNodeNoThe company's rating as shown, such as "8.6 · Excellent", after a star.
pickupRemixNodeNoWhere the car is collected, such as "In terminal · Merrow Airport".
badgesRemixNodeNoLabels over the card, such as a <Badge> reading "Great value".
priceRemixNodeYesThe daily price, formatted by the caller, such as "$38".
priceUnitRemixNodeNoWhat the price is per, such as "/ day", after it in small type.
totalRemixNodeNoThe total for the rental, such as "$266 total".
actionsRemixNodeNoThe select link or button, under the price.

Also accepts everything in Omit<TagProps<"article">, "children">.

Types

NameValuesWhat it decides
SpecKind"seats" | "bags" | "doors" | "transmission" | "fuel" | "electric" | "ac" | "mileage"What a spec chip states, which picks its icon.
@sdxc/ui

Can’t find it? Contact us