badge
Short styled text fragment atom, typically used for inline tags or status chips.
struct Component
pub struct ComponentA short styled text fragment.
| Field | Type | Description |
|---|---|---|
style |
Style | Style painted over the whole text. |
text |
String | Text shown as is, with no padding or truncation. |
Implements Display.
Component::new
pub fn new(text: impl Into<String>, style: Style) -> SelfCreate a badge with the given text and style.
| Parameter | Type | Description |
|---|---|---|
text |
impl Into<String> | the text to show |
style |
Style | the style to paint it in |
| returns | Self | The badge, ready to display. |