Language

Elements and nesting

Use indentation, selectors, attributes, text, and interpolation to describe a component tree.

source

Every indented line becomes a child of the line above it. Indentation must use spaces; tabs are rejected with a source-located diagnostic.

Hero.btsxbtsx
main.page  section#intro.hero    h1 Beast    p Indentation becomes structure.
BTSXMeaning
sectionHTML element
CardComponent reference
Theme.ProviderDotted component reference
.carddiv with class card
section.herosection with class hero
section#intro.herosection with an ID and class

Attributes live in parentheses and may be separated by spaces or commas. Beast normalizes class to className and combines it with selector shorthand.

Button.btsxbtsx
Button(tone="primary" count={items.length} disabled) Continue

Inline text follows a selector. Use #{...} for expressions and a pipe for a line that should always be interpreted as text.

Inbox.btsxbtsx
p Hello, #{user.name}. You have #{messages.length} messages. div.notice  | This line is text, not an element selector.