For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
/
3
Sponsor

Label

A text label with macOS typography styles.

Import

use maccn::{LabelStyle, MacLabel};

Usage

MacLabel::new("title")
    .style(LabelStyle::Title1)
    .child("Hello World");

Variants

use gpui::div;
use maccn::{LabelStyle, MacLabel};
 
div()
    .flex()
    .flex_col()
    .gap_1()
    .child(MacLabel::new("l-lt").style(LabelStyle::LargeTitle).child("Large Title"))
    .child(MacLabel::new("l-t1").style(LabelStyle::Title1).child("Title 1"))
    .child(MacLabel::new("l-t2").style(LabelStyle::Title2).child("Title 2"))
    .child(MacLabel::new("l-t3").style(LabelStyle::Title3).child("Title 3"))
    .child(MacLabel::new("l-hl").style(LabelStyle::Headline).child("Headline"))
    .child(MacLabel::new("l-body").style(LabelStyle::Body).child("Body"))
    .child(MacLabel::new("l-co").style(LabelStyle::Callout).child("Callout"))
    .child(MacLabel::new("l-sh").style(LabelStyle::Subheadline).child("Subheadline"))
    .child(MacLabel::new("l-fn").style(LabelStyle::Footnote).child("Footnote"))
    .child(MacLabel::new("l-c1").style(LabelStyle::Caption1).child("Caption 1"))
    .child(MacLabel::new("l-c2").style(LabelStyle::Caption2).child("Caption 2"))

API

Props

PropTypeDefault
styleLabelStyleBody
secondaryboolfalse

LabelStyle

VariantSizeWeight
LargeTitle26pxNormal
Title122pxNormal
Title217pxNormal
Title315pxNormal
Headline13pxBold
Body13pxNormal
Callout12pxNormal
Subheadline11pxNormal
Footnote10pxNormal
Caption110pxNormal
Caption210pxNormal

Traits

TraitDescription
StyledSet color, alignment, etc.
ParentElementAdd content via .child().