Components
Built-in MDX components for composing Brandtree brand websites.
Start with a live preview, copy the minimal Usage example, then explore the variations and API reference. Previews use the included sample brand; each Code tab shows the MDX for its displayed example. Use the site’s theme control to compare light and dark.
How components receive your brand
Brandtree makes the 28 components in this reference available by name in content MDX. You do not need imports or shared props: built-ins automatically receive the resolved brand, interface strings, and text direction for the current page. This also works for built-ins nested inside other components in your MDX.
<Logo />
<ColorPalette />
<Glyphs />
Override a value for one component
Pass brand, ui, or dir explicitly when a specimen needs a different value.
Your prop takes precedence over the page’s value for that component. Overrides
replace the supplied object; they are not deep-merged. Spread the page value
when changing only part of it:
<Callout ui={{ ...props.ui, content: { ...props.ui.content, note: "Design note" } }}>
Keep the original proportions.
</Callout>
<Glyphs dir="rtl" />
props.brand, props.ui, and props.dir remain available for expressions,
selectors, and custom components. An override affects only the component that
receives it; it does not change the page or nested components’ defaults.
Automatic shared props apply to built-ins rendered in Brandtree content MDX. Custom components still need explicit inputs. Inside an Astro component, import built-ins and pass the values they require; MDX does not inject props into an Astro template. See Custom components.
All component examples belong in a Brandtree content .mdx file. Import statements go after YAML frontmatter. Strings use quotes; numbers, booleans, objects, and arrays use braces. A self-closing component has no children; a paired component wraps prose or other components. Leave blank lines around Markdown inside paired tags so paragraphs and lists are parsed correctly. See Pages and MDX for complete page examples and Astro’s MDX guide for the underlying syntax.
The API tables describe authoring in Brandtree MDX. Shared brand, ui, and
dir props are optional overrides with page-level defaults. Props listed as
required still need an authored value. All components accept an optional class string except ColorSwatch. A class adds a hook to the outer element; it does not add arbitrary HTML props or inline styles to the public API.
Component selectors refer to configured IDs, not display labels, unless explicitly stated. Use Configuration to define brand data, and Media for image imports, SVGs, and downloadable files.
Layout and prose
Block
Place explanatory copy beside a specimen.
Grid
Arrange related exhibits in responsive columns.
Panel
Frame artwork with configured color pairings.
Figure
Display images, captions, and draft placeholders.
Callout
Explain approved usage, mistakes, or notes.
Spec List
Present dimensions and other key/value specifications.
Statement
Give an important brand statement room to stand out.
Logo system
Logo
Render approved theme-aware artwork.
Logo Clearspace
Demonstrate the protected area around a mark.
Logo Colorways
Show approved foreground and background combinations.
Logo Scaling
Compare the mark at specified sizes.
Construction Grid
Overlay a drawing grid on logo artwork.
Logo Misuse
Show transformations readers should avoid.
Color
Color Palette
Display approved swatches and print values.
Color Swatch
Show one configured swatch.
Color Scale
Explore shade families and tint ramps.
Contrast Matrix
Compare contrast ratios across the palette.
Typography
Type Specimen
Introduce a configured display or text family.
Type Scale
Document hierarchy, styles, and print specifications.
Font Weights
Compare configured typeface weights.
Glyphs
Inspect character coverage and writing direction.
Voice and audience
Tone Sliders
Locate the brand voice between contrasting traits.
Value Grid
Explain the principles that guide the brand.
Persona Card
Describe audiences with facts and supporting prose.
Asset collections
Icon Grid
Present a named collection of SVG icon specimens.
Photo Grid
Compare photography and image treatments.
Downloads
Link reusable packages registered in brand config.
Layout Grid
Document columns, gutters, margins, and proportions.
Custom components and layouts
See Custom components for custom components and prop forwarding, and Styling and tokens for CSS, local scrolling, and theme support. Keep structured brand facts in configuration and editorial explanations in MDX.
CoverPage and SectionOpener are internal layout components, not built-in MDX names. The generated runtime owns the site shell, navigation, theme controls, and cover composition. Do not add application routes or edit generated .brandtree/ files to use the authoring components.