Complete reference for built-in Chalk elements and attribute types.
Primitive Elements
Chalk provides the following built-in primitive elements that are always available:
| Element | Syntax | Description | Attributes |
|---|---|---|---|
paragraph |
paragraph{...}(color: value) |
Basic text block element | color (optional string) |
h1 |
# Heading Text |
Heading level 1 | None |
h2 |
## Heading Text |
Heading level 2 | None |
h3 |
### Heading Text |
Heading level 3 | None |
h4 |
#### Heading Text |
Heading level 4 | None |
h5 |
##### Heading Text |
Heading level 5 | None |
h6 |
###### Heading Text |
Heading level 6 | None |
Primitive Attribute Types
Chalk provides the following built-in attribute types:
| Type | Description | Accepted Values | Example |
|---|---|---|---|
string |
Text values | Any string | hello world |
number |
Numeric values | Numbers, including decimals | 42, 3.14 |
boolean |
True/false values | true/false, yes/no, 1/0 |
true, yes, 1 |
string-list |
Comma-separated strings | Comma-separated string values | tag1,tag2,tag3 |
number-list |
Comma-separated numbers | Comma-separated numeric values | 1,2,3,4 |
formatted-string |
Text with markdown formatting | Text with bold, italic, code, links, $math$ |
**bold** and *italic* text |
Usage Examples
Headings
# Main Title
## Section Header
### Subsection
Paragraphs
This is a regular paragraph.
paragraph(color: blue) {
This paragraph has a custom color.
}
Attributes
element(
title: My Title
count: 42
enabled: true
tags: javascript,react,web
description: This supports **bold** and *italic* formatting
)
Next Steps
- API Documentation - Back to API documentation index
- API Methods - Complete API reference
- Key Concepts - Understanding Chalk fundamentals
- Defining Libraries - Creating custom elements and types
- Language Guide - Learn the Chalk language
- Home - Back to documentation home