Select

Stable

High-density dropdown select menus featuring custom chevron animations, cyber-glow perimeters, and optgroup categorization.

Installation

$pnpm add @siberui/react

Import

tsx
import { Select } from '@siberui/react';

Basic Usage & Option Sets

Pass an array of options with value-label objects and configure descriptive helper text.

Select target region for realtime commit sync

tsx
<div className="max-w-sm w-full">
  <Select
    label="PRIMARY REPLICATION GATEWAY"
    placeholder="Choose egress region..."
    helperText="Select target region for realtime commit sync"
    options={[
      { value: 'us-east', label: 'US East (Virginia Hub)' },
      { value: 'us-west', label: 'US West (Oregon Node)' },
      { value: 'eu-central', label: 'EU Central (Frankfurt Nexus)' },
      { value: 'ap-east', label: 'AP East (Hong Kong Uplink)' },
    ]}
  />
</div>

Categorized Option Groups

Organize complex multi-tier lists into formatted categories using optgroup structures.

tsx
<div className="max-w-sm w-full">
  <Select
    label="ORBITAL CLUSTER REGION"
    placeholder="Select planetary node..."
    options={groupedOptions}
  />
</div>

Visual Variants (Neon, Glass, Ghost)

Select between glowing monospace neon, translucent acrylic glass, minimal ghost, or clean solid default.

tsx
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 w-full max-w-2xl">
  <Select
    variant="neon"
    label="AI INFERENCE MODEL"
    options={[
      { value: 'gpt-siber-v4', label: 'Cyber-LLM v4 (Quantum)' },
      { value: 'neural-mesh-v2', label: 'Neural Mesh v2 (Lattice)' },
    ]}
  />

  <Select
    variant="glass"
    label="ENCRYPTION PROTOCOL"
    options={[
      { value: 'lattice', label: 'Kyber-1024 (Post-Quantum)' },
      { value: 'curve', label: 'Curve25519 (Elliptic)' },
    ]}
  />
</div>

Validation States (Error & Success)

Display contextual validation perimeters and chevron colors using error or success props.

Latency 0.38ms within permissible bounds

tsx
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 w-full max-w-2xl">
  <Select
    label="DECOMMISSIONED SUBNET"
    error="GATEWAY_OFFLINE: Destination port 443 is quarantined"
    options={basicOptions}
    defaultValue="us-west"
  />

  <Select
    label="VERIFIED UPLINK ROUTE"
    success
    helperText="Latency 0.38ms within permissible bounds"
    options={basicOptions}
    defaultValue="eu-central"
  />
</div>

Scale & Density (sm, md, lg)

Calibrate menu button heights across sm (32px), md (40px), and lg (48px).

tsx
<div className="flex flex-col gap-4 max-w-sm w-full">
  <Select selectSize="sm" options={basicOptions} placeholder="Compact menu (sm - 32px)..." />
  <Select selectSize="md" options={basicOptions} placeholder="Standard menu (md - 40px)..." />
  <Select selectSize="lg" options={basicOptions} placeholder="Hero menu (lg - 48px)..." />
</div>

Frosted Cyber-Glass Cluster Target Selector

Compose acrylic select dialogs nested on circuit textures with animated boundary beams.

ROUTING GATEWAY TARGET
BGP-4
tsx
<div className="relative w-full max-w-md p-8 rounded-2xl bg-white/[0.04] backdrop-blur-xl border border-white/10 shadow-2xl overflow-hidden">
  <div className="relative z-10 space-y-6">
    <div className="flex items-center justify-between pb-4 border-b border-white/[0.08]">
      <div className="flex items-center gap-2">
        <Globe className="h-4 w-4 text-cyan-400" />
        <span className="font-mono text-xs font-bold text-white tracking-wider">ROUTING GATEWAY TARGET</span>
      </div>
      <Badge variant="glass" dot dotColor="cyan">BGP-4</Badge>
    </div>

    <div className="space-y-4">
      <Select
        variant="glass"
        label="PRIMARY EGRESS CLUSTER"
        options={groupedOptions}
        defaultValue="fra-03"
      />
      <Select
        variant="glass"
        label="FAILOVER PEER"
        options={groupedOptions}
        defaultValue="dub-01"
      />
    </div>

    <div className="pt-2">
      <Button variant="neon" glow className="w-full">
        ESTABLISH BGP PEER
      </Button>
    </div>
  </div>
  <BorderBeam variant="neon" size={140} duration={6} borderWidth={1.5} glow />
</div>

Tactical HUD Defense Dispatch Console

Composite defense dispatch dropdown card with live threat status metadata.

SENTINEL DISPATCH MATRIX

READY

Route incoming sector alerts to active defense agents.

tsx
<Card className="max-w-md mx-auto border-cyan-500/30 bg-[#070b14] shadow-xl">
  <CardHeader className="pb-4 border-b border-white/[0.06]">
    <div className="flex items-center justify-between">
      <CardTitle className="text-sm font-mono text-cyan-400 tracking-wider">SENTINEL DISPATCH MATRIX</CardTitle>
      <Badge variant="neon" size="sm">READY</Badge>
    </div>
    <CardDescription className="text-xs text-slate-400">
      Route incoming sector alerts to active defense agents.
    </CardDescription>
  </CardHeader>

  <CardContent className="p-6 space-y-4">
    <Select
      variant="neon"
      label="ASSIGNED TACTICAL SENTINEL"
      options={[
        { value: 's-01', label: 'SENTINEL_ALPHA (Kinetic Rail)' },
        { value: 's-02', label: 'SENTINEL_BETA (EMP Wave)' },
        { value: 's-03', label: 'SENTINEL_GAMMA (Laser Intercept)' },
      ]}
      defaultValue="s-01"
    />

    <Select
      variant="neon"
      label="INTERCEPTION ESCALATION LEVEL"
      options={[
        { value: 'def-1', label: 'DEFCON 1 — Immediate Kinetic Strike' },
        { value: 'def-2', label: 'DEFCON 2 — Lock Target & Await Ack' },
        { value: 'def-3', label: 'DEFCON 3 — Passive Surveillance' },
      ]}
      defaultValue="def-2"
    />

    <div className="pt-2 flex justify-end gap-3">
      <Button variant="secondary" size="sm">STAND DOWN</Button>
      <Button variant="neon" size="sm" glow>DEPLOY ORDERS</Button>
    </div>
  </CardContent>
</Card>

API Reference

PROPERTIES (8)← swipe to inspect →
PropertyDescriptionTypeDefault
options
Array of flat SelectOption objects or categorized SelectOptionGroup records.
(SelectOption | SelectOptionGroup)[]
[]
variant
Visual surface styling and laser glow preset.
"default" | "neon" | "glass" | "ghost" | "primary" | "primary-subtle" | "primary-outline"
"default"
selectSize
Physical touch target height and text density.
"sm" | "md" | "lg"
"md"
label
Monospace label linked above the select trigger.
string
-
helperText
Instructional subtext beneath the input field.
string
-
placeholder
Initial disabled placeholder string shown when no value is chosen.
string
-
error
Displays a high-priority warning message and activates danger state ring.
string | boolean
-
success
Activates emerald verified perimeter styling.
boolean
false

Accessibility

  • Native HTML Select: Uses native HTML <select> elements for zero-overhead performance, automatic mobile OS picker wheel integration, and complete keyboard accessibility.
  • Focus Visibility: Features high-contrast focus-visible:ring-2 halos.
  • Label Association: The label prop automatically pairs with the select element via unique ID matching.

Best Practices

  • Option Counts: Select is best suited for 5 to 50 options. For fewer than 5 options, consider using RadioGroup; for over 50 options or searchable items, use Combobox.
  • Group Labels: Always use uppercase headers for optgroup items to match the cyber aesthetic.