import { useState } from 'react' // All 50 states + DC, matching the API's ALLOWED_STATES const STATES = [ 'AL','AK','AZ','AR','CA','CO','CT','DE','DC','FL','GA','HI', 'ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT', 'NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD', 'TN','TX','UT','VT','VA','WA','WV','WI','WY' ] const STATE_NAMES = { AL: 'Alabama', AK: 'Alaska', AZ: 'Arizona', AR: 'Arkansas', CA: 'California', CO: 'Colorado', CT: 'Connecticut', DE: 'Delaware', DC: 'District of Columbia', FL: 'Florida', GA: 'Georgia', HI: 'Hawaii', ID: 'Idaho', IL: 'Illinois', IN: 'Indiana', IA: 'Iowa', KS: 'Kansas', KY: 'Kentucky', LA: 'Louisiana', ME: 'Maine', MD: 'Maryland', MA: 'Massachusetts', MI: 'Michigan', MN: 'Minnesota', MS: 'Mississippi', MO: 'Missouri', MT: 'Montana', NE: 'Nebraska', NV: 'Nevada', NH: 'New Hampshire', NJ: 'New Jersey', NM: 'New Mexico', NY: 'New York', NC: 'North Carolina', ND: 'North Dakota', OH: 'Ohio', OK: 'Oklahoma', OR: 'Oregon', PA: 'Pennsylvania', RI: 'Rhode Island', SC: 'South Carolina', SD: 'South Dakota', TN: 'Tennessee', TX: 'Texas', UT: 'Utah', VT: 'Vermont', VA: 'Virginia', WA: 'Washington', WV: 'West Virginia', WI: 'Wisconsin', WY: 'Wyoming' } /** * Landing screen — prompts user to select a state. * Matches the Civilytics visual style with eyebrow label, stat callout, and clean card layout. */ export default function StateSelector({ onNext }) { const [query, setQuery] = useState('') // Filter states by code or name as user types const filtered = STATES.filter( (code) => code.toLowerCase().includes(query.toLowerCase()) || STATE_NAMES[code].toLowerCase().includes(query.toLowerCase()) ) return (
{/* Eyebrow */} US Department of Education Civil Rights Data Collection {/* Hero */}

Explore school-based arrest rates by district

The Civil Rights Data Collection (CRDC) is the only source of data on school-related arrests for all U.S. public schools and districts. Enter a state to see estimates for any district — with Bayesian model comparisons that reveal how confident we can be in each rate, even when arrests are rare events.

{/* Stat callout — key context */}
34,846 students arrested in 2021–22
0.72 arrests per 1,000 students (national rate)
11.6% of districts reported >0 arrests
{/* Search input */}
setQuery(e.target.value)} style={{ width: '100%', padding: 'var(--space-2)', fontSize: '1rem', border: '1px solid var(--cv-rule)', borderRadius: 'var(--radius-md)', fontFamily: 'var(--font-sans)' }} autoFocus /> {/* Filtered grid of states */} {filtered.length > 0 && (
{filtered.map((code) => ( ))}
)} {filtered.length === 0 && (

No states match "{query}". Try a full state name or two-letter code.

)}
{/* Context footer */}
How it works

After selecting a state, you'll search for a school district and see arrest estimates from 10 Bayesian models — including one-year vs. three-year specifications and baseline vs. referral-rate covariate models. The app fetches data directly from the{' '} CRDC Arrest Rate API . No account or key required.

) }