Urgent.News

What's breaking now, across thousands of outlets.

Tech

๐Ÿ”ด Badge RS: Easy to Use Badge Components for WASM Frameworks

Je vous salue ๐Ÿ‘‹! Every WASM app eventually needs a badge. The little red circle on your notification bell. The green dot on the corner of an avatar. The "99+" that taunts you every morning from the inbox icon. They're everywhere, and somehow everyone is still hand-rolling them. That stops today. We're shipping Badge RS . What Is Badge RS? Badge RS is a production-ready badge component for Yew ,โ€ฆ

Badge RS is a new badge component that simplifies the creation of notification counters, status dots, and overflow labels for Yew, Dioxus, and Leptos frameworks. This production-ready component handles positioning, sizing, color theming, and accessibility out of the box.

The core of Badge RS is the positioning wrapper, which wraps any element and turns it into a badge target using `position: relative; display: inline-flex;`. This approach ensures that the badge doesn't disrupt the layout, doesn't interfere with the accessibility tree, and doesn't require any CSS tricks to work.

The `Badge` component is the actual indicator. It accepts children to display a labeled badge with text inside or skips children to create a compact badge without extra props. There are also separate components for status dots that don't require any props.

Badge RS introduces a `Shape` enum to address the common issue of badges floating slightly off the corner of circular elements like avatars. By using `Shape::Circle`, the badge is positioned precisely on the arc, ensuring a flush fit on rectangular elements. This feature is crucial for maintaining visual consistency across different types of elements.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

๐Ÿƒ Card RS: Extremely Customizable Card component for WASM frameworks

Salut tout le monde ๐Ÿ‘‹! If there is one layout component that has been re-implemented more times than the <button> , it's the Card. Think about it.

  • Card RS is customizable Card component for WASM frameworks
  • Provides clean, composable UI surfaces with BEM boilerplate
  • Adheres to WCAG guidelines with ARIA role=article

A Service Exists When It Is Declared

The card in a service catalog is a rendering of the manifest, not a table somebody remembers to update. ๐Ÿ‘‹ Hi, I'm Anton - a software engineer working mostly in PHP/Symfony and Go, currently carving aโ€ฆ

  • Service version can be inaccurate due to missing symbol in build process.
  • Service manifest declares components like daemons, handlers, databases, queues.
  • Service declaration should be primary source of truth to avoid discrepancies.

More from Sunday 27 September โ†’