Back to Slint

FontWeight

docs/astro/src/content/docs/reference/global-namespaces/font-weight.mdx

1.17.1730 B
Original Source

The FontWeight namespace contains constants for various font weights, following the CSS specification.

Constants

The following constants are available in the FontWeight namespace. They are all unitless float values.

NameValueDescription
thin100Thin
extra-light200Extra Light
light300Light
normal400Normal
medium500Medium
semi-bold600Semi Bold
bold700Bold
extra-bold800Extra Bold
black900Black

Example

slint
export component Example inherits Window {
    Text {
        text: "Hello World";
        font-weight: FontWeight.bold;
    }
}