HandDrive
Universal RHD (right-hand drive) and LHD (left-hand drive) component with API-first design.
Import:
import HandDrive from 'spoko-design-system/src/components/HandDrive.astro'
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
handDrive | 'lhd' | 'rhd' | Yes | - | Hand drive type |
text | string | No | - | Display text from API |
class | string | No | - | CSS classes for styling |
biggerText | boolean | No | false | Use larger text size |
title | string | No | - | Override tooltip text |
Examples
LHD (Left-Hand Drive)
Left-Hand Drive
<HandDrive handDrive="lhd" text="Left-Hand Drive" />
RHD (Right-Hand Drive)
Right-Hand Drive
<HandDrive handDrive="rhd" text="Right-Hand Drive" />
Without Text
<HandDrive handDrive="lhd" />
With Custom Styling
Left-Hand Drive
<HandDrive
handDrive="lhd"
text="Left-Hand Drive"
class="mb-4 border rounded p-2"
biggerText={true}
/>
Design Principles
- Universal: No i18n dependencies, works across multiple projects
- API-first: All data comes from consistent API endpoints
- Self-documenting: ‘lhd’/‘rhd’ values are clear in any language
- Type-safe: Strong TypeScript support with string literals
- Clean: No magic numbers or mixed value types