label.rs

 1use gpui::{Div, Render};
 2
 3use crate::prelude::*;
 4use crate::{HighlightedLabel, Label, Story};
 5
 6pub struct LabelStory;
 7
 8impl Render for LabelStory {
 9    type Element = Div;
10
11    fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
12        Story::container(cx)
13            .child(Story::title_for::<Label>(cx))
14            .child(Story::label(cx, "Default"))
15            .child(Label::new("Hello, world!"))
16            .child(Story::label(cx, "Highlighted"))
17            .child(HighlightedLabel::new(
18                "Hello, world!",
19                vec![0, 1, 2, 7, 8, 12],
20            ))
21            .child(HighlightedLabel::new(
22                "Héllo, world!",
23                vec![0, 1, 3, 8, 9, 13],
24            ))
25    }
26}