Nighty Docs
  • About Nighty
  • Getting Started
    • First Launch
    • Usage Guide
  • 🛠️Troubleshooting
    • The application did not respond / Unknown Integration
    • Common solutions to all issues
    • Unable to launch
    • App is just a white box, UI not appearing / looking weird
    • Retrieving License Key
    • Flagged key
    • Rich Presence doesn't show up
  • UI SCRIPTING
    • API Reference
      • Tab
      • CardContainer
      • Card
      • Group
      • UI Elements
        • Text
        • Button
        • Input
        • Image
        • Toggle
        • Select
        • Checkbox
        • Table
Powered by GitBook
On this page

Was this helpful?

  1. UI SCRIPTING
  2. API Reference
  3. UI Elements

Text

UI Element - Text

PreviousUI ElementsNextButton

Last updated 4 months ago

Was this helpful?

class UI.Text

All attributes are read/write: You can access (read) and modify (set) any attribute at any time, and the changes will immediately reflect in the UI.

# Appending text to a card
text = card.create_ui_element(UI.Text,
    content="Hello, World!",
    size="sm",
    weight="bold",
    color="#FFFFFF",
    align="left"
)

# Appending text to a card, leaving the default settings
text = card.create_ui_element(UI.Text)

# Setting attributes
text.content = "Hello, World"
Attribute
Value

content

any string

Note: use \n to create a new line.

size

"tiny"

"sm"

"base"

"lg"

"xl"

"2xl" Default: "base"

weight

"thin"

"light"

"normal"

"medium"

"bold"

"extrabold" "black" Default: "normal"

color

Any CSS valid color value.

Examples: "#FFFFFF" "black" "rgb(255, 0, 0)" "hsla(0, 100%, 50%, 0.5)"

Default: "#FFFFFF"

align

"left"

"center"

"right" Default: "left"

margin

visible

See:

See . Default: "m-0"

See . Default: True

CSS Color Values
Margin
Visible