β¨ TailYew
A modern, reusable component library for Yew apps β powered by Tailwind CSS and written fully in Rust.
π 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 dynamicFormBuilderblocks - π 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-describedbysupport (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
FormandFormBuilderwith fully composable inputs, modal support, and accessible feedback
See all live: https://tailyew.com
β‘ Quick Start
β Option 1: Use the Starter Template (Recommended)
Then open π http://localhost:8080
You get:
- Hot reloading
- Preconfigured TailwindCSS
- All TailYew components ready to use
β Option 2: Add TailYew to Your Own App
In your Cargo.toml:
= "0.1.21"
β‘οΈ 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.
π Recommended: Use the Built-in Safelist HTML
TailYew includes a tailyew-safelist.html file that lists all runtime classes. Add it to your tailwind.config.js:
module.exports = ;
To copy the safelist file into your project:
β οΈ 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
# Update Tailwind config
# 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
π€ 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
- π₯ Open a Pull Request
- π Report a Bug
- π‘ Propose a Feature
π Related Projects
- π¦ Yew Framework
- π¨ TailwindCSS
- π TailYew Starter
π Thank you for helping grow the Rust UI ecosystem!
π License
MIT License β see LICENSE