Election Results
Two components for election night coverage: a candidate results table with party-colored summary bar, and a vote margin indicator with historical comparison. Built-in party color recognition for Democratic, Republican, Libertarian, Green, and Independent.
Presidential Race
2024 Presidential Election
National popular vote
99% of precincts reporting
Donald Trump ✓ Republican
49.6% 77,302,892
Kamala Harris Democratic
48.1% 75,012,341
Chase Oliver Libertarian
1.3% 2,048,532
Jill Stein Green
1.0% 1,548,210
| Candidate | Party | Votes | Share |
|---|---|---|---|
| Kamala Harris | Democratic | 75,012,341 | 48.1% |
| Donald Trump | Republican | 77,302,892 | 49.6% |
| Chase Oliver | Libertarian | 2,048,532 | 1.3% |
| Jill Stein | Green | 1,548,210 | 1.0% |
Senate Race
Pennsylvania Senate
2024 general election
97% of precincts reporting
Dave McCormick ✓ Republican
49.8% 3,395,201
Bob Casey Democratic
48.7% 3,320,145
John Thomas Libertarian
1.5% 102,340
| Candidate | Party | Votes | Share |
|---|---|---|---|
| Bob Casey | Democratic | 3,320,145 | 48.7% |
| Dave McCormick | Republican | 3,395,201 | 49.8% |
| John Thomas | Libertarian | 102,340 | 1.5% |
Vote Margin
2024 Presidential Popular Vote Margin
Republican +1.5
Margin with Historical Comparison
Presidential Popular Vote Margin Over Time
Republican +1.5
2008 +7.3
2012 +3.9
2016 -2.1
2020 +4.5
2024 -1.5
Colorblind-Safe Mode
2024 Presidential (colorblind palette)
Donald Trump ✓ Republican
49.6% 77,302,892
Kamala Harris Democratic
48.1% 75,012,341
Chase Oliver Libertarian
1.3% 2,048,532
Jill Stein Green
1.0% 1,548,210
| Candidate | Party | Votes | Share |
|---|---|---|---|
| Kamala Harris | Democratic | 75,012,341 | 48.1% |
| Donald Trump | Republican | 77,302,892 | 49.6% |
| Chase Oliver | Libertarian | 2,048,532 | 1.3% |
| Jill Stein | Green | 1,548,210 | 1.0% |
Margin (colorblind)
Republican +1.5
2008 +7.3
2012 +3.9
2016 -2.1
2020 +4.5
2024 -1.5
ElectionResults — Usage
<ElectionResults
data={[
{ candidate: 'Harris', party: 'Democratic', votes: 75012341, pct: 0.481 },
{ candidate: 'Trump', party: 'Republican', votes: 77302892, pct: 0.496 },
]}
title="2024 Presidential Election"
precinctsPct={0.99}
/>ElectionResults — Props
PropTypeDefault
dataCandidateRow[]requiredtitlestringrequiredprecinctsPctnumber (0–1)—winnerstringauto (highest votes)colorMode'default' | 'colorblind'auto-detectpartyColorsRecord<string, string>built-in D/R/I/L/G colorsVoteMargin — Usage
<VoteMargin
margin={-1.5}
title="Popular Vote Margin"
historical={[
{ year: 2016, margin: -2.1 },
{ year: 2020, margin: 4.5 },
]}
/>Positive margin = party A leads. Negative = party B leads.
VoteMargin — Props
PropTypeDefault
marginnumberrequiredpartyA / partyBstring'Democratic' / 'Republican'historical{ year, margin }[][]maxMarginnumber30colorMode'default' | 'colorblind'auto-detectData Shape
interface CandidateRow {
candidate: string;
party: string; // 'Democratic', 'Republican', 'Libertarian', etc.
votes: number;
pct: number; // 0–1 (0.481 = 48.1%)
}