Locus Input
@genomics/locus-input
Coordinates or gene symbols, resolved.
Preview
TP53 — chr17:7,668,421-7,687,550 (19,130 bp)
Coordinates resolve locally with no network call; gene symbols go to Ensembl, aborting any lookup they supersede. Focus the field to see recent loci.
About
A genome browser has one primary input, and it accepts two kinds of thing users don't distinguish between: coordinates (chr7:140,753,336-140,753,400) and names (BRAF). Coordinate parses resolve locally with no network call — they're unambiguous, so waiting on Ensembl would be pure latency — while symbol lookups abort whichever request they supersede. A failed lookup says so instead of silently doing nothing, and recent loci come back on focus, since navigation is overwhelmingly a return to somewhere you've already been.
Usage
import { LocusInput } from "@/components/ui/locus-input"
<LocusInput
value={locus}
onChange={setLocus}
suggestions={["TP53", "EGFR", "BRCA1"]}
/>Registry dependencies
Source:
components/ui/locus-input.tsx