Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Nucleotide

    DNA and RNA bases as colored tiles, and whole strands as blocks of them: a numbered ruler, the complementary strand, codons with what they make, highlights and selection. Every color scheme is drawn in one tone system, so the classic schemes sit next to Nelumbo's palette at one even lightness.

    Install

    npx shadcn@latest add @nelumbo/nucleotide

    Bases

    A tile per base, named on hover. Ambiguity codes are neutral, a gap has no tile.

    ACGTU
    NRYSWKMBDHV-

    Variants and sizes

    Tonal is the default. Solid is the full-strength tile that selection uses, subtle fades context, text drops the tile for long runs.

    tonal
    GATC
    GATC
    GATC
    solid
    GATC
    GATC
    GATC
    subtle
    GATC
    GATC
    GATC
    text
    GATC
    GATC
    GATC

    Shape

    Sequences are connected by default, like a connected button group: corners tighten where bases meet and stay round at the ends of each block, and a selection becomes its own capsule. separate keeps every corner round.

    connected
    ATGGAGGAGC
    CGCAGTCAGA
    TCCTAGCGTC
    separate
    ATGGAGGAGC
    CGCAGTCAGA
    TCCTAGCGTC

    Color schemes

    Base pairs and purines and pyrimidines are Nelumbo's own. The others take their tools' hues, drawn at Nelumbo's lightness; the color-blind-safe set keeps its lightness steps.

    Nelumbo

    A green, C blue, G amber, T red, on the palette's hues

    ACGTTGCAGATTACAGCT

    Base pairs

    A and T share green, G and C share blue: complements match by eye

    ACGTTGCAGATTACAGCT

    Purines and pyrimidines

    Warm purines, cool pyrimidines

    ACGTTGCAGATTACAGCT

    IGV

    The Integrative Genomics Viewer's hues

    ACGTTGCAGATTACAGCT

    Jalview

    Jalview's nucleotide hues

    ACGTTGCAGATTACAGCT

    Sanger trace

    Chromatogram colors, G in gray

    ACGTTGCAGATTACAGCT

    Color-blind safe

    Okabe and Ito's set, apart in lightness as well as hue

    ACGTTGCAGATTACAGCT

    None

    Neutral tiles

    ACGTTGCAGATTACAGCT

    Double strand

    complement draws the paired base under each one, faded. With the base pairs scheme, every pair shares a hue.

    ATGGAGGAGC
    CGCAGTCAGA
    TCCTAGCGTC
    GAGCCCCCTC
    ATGGAGGAGC
    CGCAGTCAGA
    TCCTAGCGTC
    GAGCCCCCTC

    Codons

    A block of three with a footer: each codon over the amino acid it makes.

    ATG
    M
    GAG
    E
    GAG
    E
    CCG
    P
    CAG
    Q
    TCA
    S
    GAT
    D
    CCT
    P
    AGC
    S
    GTC
    V
    GAG
    E
    CCC
    P
    CCT
    P
    CTG
    L
    AGT
    S

    Mutations

    NucleotideChange shows the reference, an arrow and the changed sequence. The bases that differ are found and drawn as a solid capsule in both; deletions and insertions are padded with gaps so the two line up.

    Substitution

    HBB c.20A>T, sickle cell

    Deletion

    CFTR c.1521_1523del, F508del

    Insertion

    One base, a frameshift

    Sizes

    sm and lg

    Compact mutations

    compact keeps only the bases that changed, as small connected tiles like AminoAcidChange: A to T, CTT to a gap. position joins a neutral segment in front, so it reads like c.20A>T. Pass the full context or just the bases; the change is found the same way.

    Substitution, deletion, insertion
    ATCTT--TAGT
    With position
    20AT1521_1523CTT-
    Sizes
    524GA524GA524GA
    In text

    The sickle cell allele, 20AT, swaps one base in the sixth codon of HBB.

    GeneDNAProteinTP53524GAR175HTP53743GAR248QTP53818GAR273HBRAF1799TAV600EHBB20ATE7V

    Highlight

    highlight brings stretches forward and fades the rest. Here, the EcoRI and BamHI sites in a cloning site.

    TTCGAGCTCG
    GTACCGAATT
    CGAGCTCGGA
    TCCACTAGTA
    ACGGCCG

    Selection

    selectable makes the strand one keyboard stop, like a chart. Drag or Shift-click to select; arrows move, Shift extends, Escape clears. The readout follows the pointer.

    21bases, Positions 55 to 75
    GC 33%, reverse complement TAGTTTCCATAGGTCTGAAAA
    ATGGAGGAGC
    CGCAGTCAGA
    TCCTAGCGTC
    GAGCCCCCTC
    TGAGTCAGGA
    AACATTTTCA
    GACCTATGGA
    AACTACTTCC
    TGAAAACAAC
    GTTCTGTCCC
    CCTTGCCGTC
    CCAAGCAATG
    GATGATTTGA
    TGCTGTCCCC
    GGACGATATT
    GAACAATGGT
    TCACTGAAGA
    CCCAGGTCCA
    GATGAAGCTC
    CC

    Props

    PropTypeDefaultNotes
    Nucleotide basestringA, C, G, T, U, an IUPAC ambiguity code, or - for a gap.
    schemeNucleotideScheme"nelumbo"nelumbo, pairs, chemistry, igv, jalview, trace, okabe-ito, none.
    variant"tonal" | "solid" | "subtle" | "text""tonal"Selected tiles are always solid.
    size"sm" | "default" | "lg""default"20, 28 or 48 px tall.
    NucleotideSequence sequencestringWhitespace and digits are ignored, so FASTA and GenBank paste as is.
    groupSizenumber10A spacer every n bases. 0 for none.
    rulerboolean | "top" | "inline"falsetrue or top: first position above each block. inline: last position in the spacer.
    startnumber1Position of the first base.
    shape"connected" | "separate""connected"Connected joins each block into one shape; a selection becomes its own capsule.
    complementbooleanfalseShows the paired strand under each base.
    highlight{ start, end }[]Stretches to bring forward. 1-based, inclusive.
    footer(block) => ReactNodeDrawn under each block: codon translations, annotations.
    selectablebooleanfalsePointer and keyboard selection.
    selection / onSelectionChange{ start, end } | nullControlled selection. defaultSelection for uncontrolled.
    onActiveChange(position | null) => voidThe base under the pointer, or the keyboard cursor.
    NucleotideChange from, tostring, stringReference and changed sequence, with context. scheme and size as above.
    NucleotideChange compactbooleanfalseOnly the changed bases, as small connected tiles.
    NucleotideChange positionnumber | stringCompact only: a neutral segment joined in front of the original bases.
    HelpersalignChange, complement, reverseComplement, gcContent, translate, translateCodon, cleanSequenceStandard genetic code; RNA pairs A with U.