Inference Logoinference.sh

Title

Section headings with scalable sizes and weights.

Preview

code
1Title sm2Title md3Title lg4Title xl

Usage

go
1node := models.WidgetNode{2    Type:  models.WidgetNodeTypeTitle,3    Value: "Section Title",4    Size:  "lg",5}

Props

NameTypeDescriptionDefault
type"title"Node typerequired
valuestringText content to displayrequired
sizestringSize token: xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl"md"
weightstringFont weight: normal, medium, semibold, bold"medium"
colorstring | ThemeColorText color"prose"
textAlignstringHorizontal alignment: start, center, end"start"
truncatebooleanTruncate overflow with ellipsisfalse
maxLinesnumberLimit to maximum lines with line clamp-

Size Reference

SizeFont Size
xs0.875rem (14px)
sm1rem (16px)
md1.125rem (18px)
lg1.25rem (20px)
xl1.5rem (24px)
2xl1.875rem (30px)
3xl2.25rem (36px)

Examples

Basic Title

go
1{Type: models.WidgetNodeTypeTitle, Value: "Welcome"}

Large Title

go
1{Type: models.WidgetNodeTypeTitle, Value: "Dashboard", Size: "xl", Weight: "bold"}

Title with Subtitle

go
1{2    Type: models.WidgetNodeTypeCol,3    Gap:  1,4    Children: []models.WidgetNode{5        {Type: models.WidgetNodeTypeTitle, Value: "Settings", Size: "lg"},6        {Type: models.WidgetNodeTypeCaption, Value: "Manage your account preferences"},7    },8}

Centered Title

go
1{Type: models.WidgetNodeTypeTitle, Value: "Confirmation", TextAlign: "center"}

TypeScript

typescript
1const node: WidgetNode = {2  type: "title",3  value: "Section Title",4  size: "lg",5  weight: "semibold",6}

Best Practices

  1. Use semantic sizes - lg for main headings, md for subheadings
  2. Pair with Caption - Add context with a subtitle
  3. Keep titles concise - Aim for 2-5 words
  4. Use hierarchy - Larger titles for more important sections

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.