Start typing to search components and docs…
select navigate ESC close

HandDrive

Universal RHD (right-hand drive) and LHD (left-hand drive) component with API-first design.

Import:

<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto;" tabindex="0" data-language="js"><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> HandDrive </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'spoko-design-system/src/components/HandDrive.astro'</span></span></code></pre>

Props

PropTypeDefaultDescription
handDrive*'lhd' | 'rhd'Hand drive type
textstringDisplay text from API
classstringCSS classes for styling
biggerTextbooleanfalseUse larger text size
titlestringOverride tooltip text

Examples

LHD (Left-Hand Drive)

LHD hand drive
Left-Hand Drive
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto;" tabindex="0" data-language="js"><code><span class="line"><span style="color:#E1E4E8">&#x3C;</span><span style="color:#79B8FF">HandDrive</span><span style="color:#B392F0"> handDrive</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"lhd"</span><span style="color:#B392F0"> text</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"Left-Hand Drive"</span><span style="color:#E1E4E8"> /></span></span></code></pre>

RHD (Right-Hand Drive)

RHD hand drive
Right-Hand Drive
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto;" tabindex="0" data-language="js"><code><span class="line"><span style="color:#E1E4E8">&#x3C;</span><span style="color:#79B8FF">HandDrive</span><span style="color:#B392F0"> handDrive</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"rhd"</span><span style="color:#B392F0"> text</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"Right-Hand Drive"</span><span style="color:#E1E4E8"> /></span></span></code></pre>

Without Text

LHD hand drive
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto;" tabindex="0" data-language="js"><code><span class="line"><span style="color:#E1E4E8">&#x3C;</span><span style="color:#79B8FF">HandDrive</span><span style="color:#B392F0"> handDrive</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"lhd"</span><span style="color:#E1E4E8"> /></span></span></code></pre>

With Custom Styling

LHD hand drive
Left-Hand Drive
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto;" tabindex="0" data-language="js"><code><span class="line"><span style="color:#E1E4E8">&#x3C;</span><span style="color:#79B8FF">HandDrive</span></span> <span class="line"><span style="color:#B392F0"> handDrive</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"lhd"</span></span> <span class="line"><span style="color:#B392F0"> text</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"Left-Hand Drive"</span></span> <span class="line"><span style="color:#B392F0"> class</span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"mb-4 border rounded p-2"</span></span> <span class="line"><span style="color:#B392F0"> biggerText</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">true</span><span style="color:#E1E4E8">}</span></span> <span class="line"><span style="color:#E1E4E8">/></span></span></code></pre>

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