)}

VehicleSpecBar Component

Interactive component demo and usage examples

Full Spec Bar (Light Variant)

Default variant with all specifications shown. Best for detail pages and featured listings.

All specs:

2019
2.0L
Automatic
VEH-12345

Year and engine only:

2020
3.0L V6

Minimal (year only):

2015

Full Spec Bar (Dark Variant)

For use on dark backgrounds, hero sections, or featured vehicles.

All specs:

2021
2.5L Turbo
Manual 6-Speed
PREMIUM-2021

Partial specs:

2022
1.5L Hybrid
CVT

Compact Variant

Smaller, borderless variant ideal for vehicle cards and grid layouts.

Light compact:

2018
2.0L
Auto
REF-001

Dark compact:

2019
1.8L
Manual

Vehicle Card Examples

Real-world usage in vehicle listing cards.

🚗

BMW 320i

Premium sedan with low mileage

2019
2.0L
Auto
R 45,000
🏎️

Mercedes C-Class

Luxury engine, excellent condition

2020
2.5L
Auto
R 65,000
🚙

Toyota Corolla

Reliable, fuel efficient

2017
1.8L
Manual
R 25,000

Custom Styling Examples

Component with custom className overrides.

Blue theme:

2021
2.0L Turbo
DCT

Green theme:

2020
1.5L Hybrid
CVT

Purple theme:

2022
3.0L V6
Auto

Mobile Responsive

Component automatically wraps on smaller screens.

Engine Details

2019
2.5L V6 Twin-Turbo
8-Speed Automatic
ENG-2019-TT-001

Complete engine assembly with warranty

Imported from Japan, low mileage

Integration Examples

Copy-paste code snippets for quick integration.

Astro Page (.astro)

---
import { VehicleSpecBar } from '@/components/VehicleSpecBar';
const vehicle = await getVehicle(id);
---

<VehicleSpecBar
  year={vehicle.year}
  engineSize={vehicle.engine_size}
  transmission={vehicle.transmission}
  referenceNumber={vehicle.ref_number}
  variant="light"
  client:load
/>

React Component (.tsx)

import { VehicleSpecBar } from '@/components/VehicleSpecBar';

export function VehicleCard({ vehicle }) {
  return (
    <div>
      <VehicleSpecBar
        year={vehicle.year}
        engineSize={vehicle.engineSize}
        transmission={vehicle.transmission}
      />
    </div>
  );
}

Component Location: src/components/VehicleSpecBar.tsx

View full documentation in VehicleSpecBar.README.md

Whatsapp Us!