β¨ 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 embeddedFormBuilderblocks - βοΈ Dynamic Forms in Markdown β render live
FormBuilderblocks from fenced code likeform ...viapulldown-cmark - π 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
- π Async Forms β All forms support
FormSubmitCallbackwith loading, error, and success handling built in - π¦ Pure Rust β No JavaScript needed
- π¦ Small bundle sizes β thanks to WASM and Tailwind JIT
- π A11y support β ARIA roles, labels, and
aria-describedbysupport
π Explore live examples π https://tailyew.com/demo/getting_started
π Yew 0.22 Migration Notes
TailYew (v0.1.43) has been updated to support Yew 0.22, including:
- Adoption of the new
#[component]macro - Compatibility with updated hook and props APIs
- No required API changes for existing TailYew components
If you are upgrading from Yew 0.21:
- Your TailYew usage should continue to work without changes
- We recommend following the official Yew migration guide alongside upgrading TailYew
π Official guide: https://yew.rs/docs/next/migration-guides/yew/from-0_21_0-to-0_22_0
π Yew Version Support Policy
Starting with TailYew v0.1.43, new releases target Yew 0.22+.
- Projects still on Yew 0.21 should pin TailYew to
<= 0.1.42 - No further features will be added for Yew 0.21
π§© 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,Notification - 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
If you like this project, consider giving it a β β it helps others discover TailYew!
β‘ Quick Start
β Option 1: Scaffold via CLI (Recommended)
We now provide a zero-config CLI to bootstrap a TailYew SPA in seconds:
# 1) Install the scaffolding tool
# 2) Scaffold your project (this creates `my-app/` for you)
# 3) Change into it
# 4) Install prerequisites (once)
# 5) Start the dev server (Trunk)
Youβll get:
- A fully working Yew/WASM + Tailwind starter
- Trunk dev server with hot reload at http://localhost:9001
- A smart
Makefilewith dev commands:run-frontend,pretty, and more
β Option 2: Add TailYew to Your Own App
In your Cargo.toml:
= "0.1.44" # Yew 0.22 compatible
β‘οΈ 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
# Copy the safelist
# Update Tailwind config
# Run your app
βΏ Accessibility
TailYew is committed to accessible UI components:
- All form inputs support
aria-label,aria-describedby, and semantic labels - Modals and alerts use correct ARIA roles
- Live validation feedback is announced for screen readers
- Form errors are keyboard-navigable and styled consistently
- A11y is an ongoing area of improvement β issues and PRs welcome!
π οΈ 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
- π Create TailYew App
π Thank you for helping grow the Rust UI ecosystem!
π License
MIT License β see LICENSE