> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ton.org/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.ton.org/feedback

```json
{
  "path": "/contribute/snippets/overview",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Using components and snippets

*Snippets* keep the same content in sync across pages, while *components* provide reusable UI elements with consistent styling. Examples include a [link card](https://www.mintlify.com/docs/components/cards) or a [YouTube embed](https://www.mintlify.com/docs/create/image-embeds#youtube-embeds).

Mintlify supports MDX snippets and JSX (React) components in MDX files, and provides several [built-in components](#built-in-components). In addition, this documentation includes a number of [custom components](#custom-components) in the `snippets/` folder.

## Using a snippet

The [DRY (Don't Repeat Yourself)](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) principle applies to documentation. When the same content appears in multiple places, create a custom snippet to keep it in sync.

All snippets are placed in the root `snippets/` folder. For creation and usage details, see the [Mintlify reusable snippets documentation](https://www.mintlify.com/docs/create/reusable-snippets).

## Using a component

To use a custom component, import it into the MDX file and render it as a JSX tag. Tags start with an uppercase letter matching the name in the import statement:

```mdx title="some/page.mdx" theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
---
title: "Frontmatter goes first, as usual"
---

{/* Snippet imports go right after the frontmatter */}
import MyMdxSnippet from '/snippets/my-mdx-snippet.mdx';

{/* Component imports follow suit */}
import { Aside } from '/snippets/aside.jsx';

And now, some text and usage!

<Aside>Here we go, some **nested content and formatting**!</Aside>
```

Related Mintlify documentation:

* [JSX snippets](https://www.mintlify.com/docs/create/reusable-snippets#jsx-snippets)
* [React components](https://www.mintlify.com/docs/customize/react-components)

## Built-in components

[Mintlify provides built-in components](https://www.mintlify.com/docs/components/index) for common documentation use cases. These components are available globally without needing to import anything.

### Use sparingly

Keep formatting as simple as possible. Avoid components when a paragraph or series of paragraphs communicates the same intent and information without them.

<Card title="Steps" icon="list-ol" href="https://www.mintlify.com/docs/components/steps" horizontal="true">
  Display sequential instructions in a numbered format.
</Card>

<Card title="Code groups" icon="code" href="https://www.mintlify.com/docs/components/code-groups" horizontal="true">
  Display multiple code examples with a toggle.
</Card>

<Card title="Cards" icon="square" href="https://www.mintlify.com/docs/components/cards" horizontal="true">
  Highlight content with customizable containers and icons. Prefer regular ordered or unordered Markdown lists and resort to cards only when the relevant links and content should stand out.
</Card>

<Card title="Columns" icon="columns-3" href="https://www.mintlify.com/docs/components/columns" horizontal="true">
  Arrange \<Card> components in responsive layouts.
</Card>

<Card title="Accordions" icon="chevron-down" href="https://www.mintlify.com/docs/components/accordions" horizontal="true">
  Expandable sections for progressive disclosure of content.
</Card>

<Card title="Expandables" icon="chevrons-down" href="https://www.mintlify.com/docs/components/expandables" horizontal="true">
  Show and hide detailed content on demand. Append the expandable keyword to the opening part of a code block to collapse large examples.
</Card>

<Card title="Badge" icon="award" href="https://www.mintlify.com/docs/components/badge" horizontal="true">
  Add inline labels and status indicators for outdated or deprecated items. Otherwise, avoid this component.
</Card>

<Card title="Tooltips" icon="message" href="https://www.mintlify.com/docs/components/tooltips" horizontal="true">
  Display additional information on hover without going too deep. Link to the [glossary](/foundations/glossary), a detailed explanation page, or a reference page instead.
</Card>

<Card title="Fields" icon="input-text" href="https://www.mintlify.com/docs/components/fields" horizontal="true">
  Display parameter and property definitions, configuration options, or object fields.
</Card>

Use either of the following components only on pages that document HTTP APIs. Because they override the default auto-generated blocks, prefer regular code blocks whenever possible.

<Card title="Responses" icon="arrow-left-arrow-right" href="https://www.mintlify.com/docs/components/responses" horizontal="true">
  Show \<ResponseField> that describes API response structures and fields.
</Card>

<Card title="Examples" icon="file-code" href="https://www.mintlify.com/docs/components/examples" horizontal="true">
  Show \<RequestExample> and \<ResponseExample> side by side.
</Card>

When explaining a complex topic or writing a tutorial, use concise diagrams to clarify behavior that text and code cannot.

<Card title="Mermaid diagrams" icon="chart-diagram" href="https://www.mintlify.com/docs/components/mermaid-diagrams" horizontal="true">
  Use code blocks with [Mermaid.js](https://mermaid.js.org/) syntax to create flowcharts, sequence diagrams, and more.
</Card>

### Do not use

These components have better alternatives:

1. `<Callout>` - use the custom [`<Aside>`](/contribute/snippets/aside) component.
2. `<Frame>` - use the custom [`<Image>`](/contribute/snippets/image) component.
3. `<View>` - use `<CodeGroup>`, organize content in sub-headers, or create distinct pages per environment or language.
4. `<Tile>` - use `<Card>`.
5. `<Icon>` - do not use unless icons in other components or code blocks are insufficient in the given case.

These components are currently unused:

1. `<Banner>` - reserved for special occasions and public releases.
2. `<Update>` - the documentation does not contain changelogs.

## Custom components

TON documentation includes custom components built for various needs. See items on the left navigation panel within the "Components and snippets" group under the "Contribute" section, such as: [Aside](/contribute/snippets/aside), [Image](/contribute/snippets/image), etc.

## Styling

Mintlify supports [Tailwind CSS v3][tailwind] for styling HTML elements and any components or snippets from the `snippets/` folder.

Related resources:

* [Styling with Tailwind CSS in the Mintlify documentation](https://www.mintlify.com/docs/settings/custom-scripts#styling-with-tailwind-css)
* [Tailwind CSS v3 documentation][tailwind]
* [Unofficial Tailwind CSS v3 cheatsheet](https://tailwindcss.504b.cc/)

## See also

* [Text formatting, headers, and styling with Mintlify](https://www.mintlify.com/docs/create/text)

[tailwind]: https://v3.tailwindcss.com/docs/utility-first
