Problem Statement
React JSX is littered with the same noisy patterns: ternaries for conditional rendering (isLoggedIn ? <A/> : <B/>), nested ternaries for multi-branch logic, .map() boilerplate for iteration, ad-hoc breakpoint checks for responsive hiding, and one-off clipboard handlers. Individually trivial, collectively they make components harder to read and review. Every project re-implements them.
Proposed Solution
Meemaw is a tiny, zero-dependency React utility library of declarative components that replace those patterns with readable, intention-revealing markup — <Show>, <Switch>/<Case>/<Default>, <Hidden>, <Repeat>, <Clamp>, <CopyToClipboard> and more — so the JSX reads like what it does.
Full Solution Details
<Show when={...} fallback={...}>— conditional rendering with an optional fallback and awhen/ifalias; replaces the ubiquitous ternary.<Switch>/<Case when={...}>/<Default>— a clean match-case for multi-branch UI (order status, role, etc.) instead of nested ternaries.<Hidden when={...}>/<Hidden on="mobile">— conditional and responsive hiding by breakpoint (['mobile','tablet']), no manual media-query hooks.<Repeat>— declarative iteration without.map()ceremony.<Clamp>— time/length-based display constraints.<CopyToClipboard>— drop-in clipboard behavior.- 9 components total, each importable individually.
Technical Documentation
Pure React + TypeScript with React as the only peer dependency (zero runtime deps), shipped tree-shakeable so you only pay for what you import, total bundle under 10KB. TypeScript-first with full types out of the box, 100% test coverage (Jest), and SSR-compatible (works under Next.js, Remix, etc.). Published to npm. The design philosophy is intentionally minimal — each component is a thin, well-typed wrapper whose value is readability and consistency, not features.
Tech Stack
React (peer), TypeScript, Jest (100% coverage), tree-shakeable ESM build, npm distribution.
System Design
meemaw (≤10KB, zero-dep, peer: react)
├── Show / Hidden conditional + responsive rendering
├── Switch / Case / Default match-case branching
├── Repeat declarative iteration
├── Clamp bounded display
└── CopyToClipboard clipboard action
each export tree-shakeable · SSR-safe · 100% test coverage
Smart Architectural Decisions
- Readability as the product. The library doesn't add capability you couldn't write yourself — it makes intent obvious (
<Show when>vs a ternary). Choosing clarity as the value proposition is a mature, opinionated API decision. - Zero deps + ≤10KB + tree-shakeable means it's safe to adopt in any project without bundle guilt.
- SSR-compatible + 100% test coverage signal it's built to be depended on, not just published.
- Dual
when/ifaliasing and breakpoint-aware<Hidden on=>show attention to ergonomics and real-world usage. - Dogfooded across the author's own apps (Watchdog, WordShot, BuffByte all import it), proving it in production.
Impacts
A published, tree-shakeable npm library that cleans up conditional/iterative JSX with 100% test coverage and a <10KB footprint — and is reused as a foundation across the author's own production apps.
Demonstrated Skills
React component/library design; API ergonomics and opinionated minimalism; TypeScript typing of polymorphic components; 100% test coverage discipline (Jest); SSR-safe authoring; tree-shakeable zero-dependency packaging and npm publishing; dogfooding OSS in real products.