35 releases

new 0.1.34 Jun 16, 2025
0.1.33 Jun 13, 2025
0.1.31 May 30, 2025
0.1.15 Apr 29, 2025

#129 in Web programming

Download history 303/week @ 2025-04-02 737/week @ 2025-04-09 208/week @ 2025-04-16 431/week @ 2025-04-23 680/week @ 2025-04-30 802/week @ 2025-05-07 391/week @ 2025-05-14 344/week @ 2025-05-21 377/week @ 2025-05-28 144/week @ 2025-06-04 252/week @ 2025-06-11

1,140 downloads per month
Used in create-tailyew-app

MIT license

240KB
6.5K SLoC

✨ TailYew

A modern, reusable component library for Yew apps — powered by Tailwind CSS and written fully in Rust.

Crates.io Downloads Docs.rs License CI WASM Ready Powered by Yew Components Demo

🚀 Why TailYew?

TailYew helps you build fast, beautiful, dark-mode ready Yew apps — with minimal styling effort.

  • 🌗 Dark mode with Tailwind's dark: utilities
  • 🧹 Reusable components: Buttons, Modals, Forms, Accordions, Tabs
  • 📙 Markdown rendering Auto-maps to TailYew components (Typo, A, Image, CodeBlock) and supports dynamic FormBuilder blocks
  • 📊 Charts — Canvas-based charts (Bar, Line, Bubble, Pie, Scatter) with no JS dependencies and theme-aware data visualizations
  • 🧾 Composable Forms — Input-driven and config-driven forms with built-in state, modals, validation, and accessibility
  • 🦠 Pure Rust — No JavaScript needed
  • 📦 Small bundle sizes — thanks to WASM and Tailwind JIT
  • 📝 A11y support — ARIA roles, labels, and aria-describedby support (Ongoing improvement)

🔎 Explore live examples 👉 https://tailyew.com/demo/getting_started


🧩 Component Coverage

TailYew includes 50+ components. Below is a summary of a few key components— see the full demo here »

  • Atoms: Button, Input, Textarea, Typo, Checkbox, Select
  • Molecules: ModalButton, Popover, Accordion, Stepper, Markdown
  • Organisms: Table, Form, NavBar, Sidebar, Card, HeroHeader
  • Charts: BarChart, LineChart, BubbleChart, PieChart, ScatterPlot
  • Forms: Self-managed Form and FormBuilder with fully composable inputs, modal support, and accessible feedback

See all live: https://tailyew.com

If you like this project, consider giving it a ⭐ — it helps others discover TailYew!
Star


⚡ Quick Start

We now provide a zero-config CLI to bootstrap a TailYew SPA in seconds:

# 1) Install the scaffolding tool
cargo install create-tailyew-app

# 2) Scaffold your project (this creates `my-app/` for you)
create-tailyew-app my-app

# 3) Change into it
cd my-app

# 4) Start the dev server
make run-frontend

You’ll get:

  • A fully working Yew/WASM + Tailwind starter
  • npm install already run for you
  • cargo-watch installed for hot-reload
  • A prompt (or make run-frontend) to launch at http://localhost:8080

✅ Option 2: Add TailYew to Your Own App

In your Cargo.toml:

tailyew = "0.1.28"

⚡️ Important: Tailwind Setup (Safelist)

Tailwind CSS uses static analysis to determine which classes to include in your final CSS bundle. Since TailYew applies some classes dynamically, you must safelist them.

TailYew includes a tailyew-safelist.html file that lists all runtime classes. Add it to your tailwind.config.js:

module.exports = {
  darkMode: 'class',
  content: [
   './**/**/*.{html,js,rs}',
    './static/tailyew-safelist.html',
  ],
};

To copy the safelist file into your project:

mkdir -p vendor/tailyew
cp ~/.cargo/registry/src/*/tailyew-*/tailyew-safelist.html static/

⚠️ Alternative: Manually Add Classes

You can also manually define all TailYew utility classes in the safelist key inside tailwind.config.js. This approach is more error-prone and not recommended unless you're customizing heavily.


📂 TL;DR Setup

# Install TailYew
cargo add tailyew


cp ~/.cargo/registry/src/*/tailyew-*/tailyew-safelist.html static/

# Update Tailwind config
// tailwind.config.js
content: [
  './**/**/*.{html,js,rs}',
  './static/tailyew-safelist.html',
]

# Run your app

🛠️ Project Goals

Goal Status
🧹 Atomic Components ✅ Atoms → Molecules → Organisms
⚙️ Yew-Native Rust Code ✅ No JavaScript needed
🎨 Tailwind-First Styling ✅ Utility-first classes
🌗 Dark Mode Friendly ✅ Fully supported
📙 Typed Prop APIs ✅ Rust ergonomics

📁 Folder Structure

crates/tailyew/
├── src/
   ├── atoms/         # Low-level UI primitives (Button, Input, etc.)
│   ├── molecules/     # Combined components (Form, ModalButton, etc.)
│   ├── organisms/     # Full page structures (Navbar, Footer, Table)
│   ├── charts/        # Canvas-based charts
│   ├── form/          # Form helpers and layout
│   └── lib.rs         # Top-level exports
├── Cargo.toml         # Crate config
├── Makefile           # Dev commands (build, release-check, docs)
└── tailyew-safelist.html # ✨ Tailwind runtime classes (critical)

🤝 Contributing

We welcome contributions! ❤️

Ways you can help:

  • Suggest a new component
  • Improve UX/UI or theming
  • Add missing dark mode styles
  • Write docs or demos
  • Report bugs and issues

Before submitting a PR:

  • Run make release-check
  • Test both light mode and dark mode
  • Include before/after screenshots if you change visuals

📂 Helpful Links


🔗 Related Projects


👌 Thank you for helping grow the Rust UI ecosystem!


📜 License

MIT License — see LICENSE

Dependencies

~17–27MB
~398K SLoC