---
title: Importing code
description: "Tact allows you to import Tact and FunC code and has a versatile set of standard libraries."
---

Tact allows you to import Tact and [FunC](https://docs.ton.org/develop/func/overview) code. Any given `.tact` or `.fc`/`.func` file can be imported into your project using the `import{:tact}` keyword.

Additionally, the Tact compiler has a versatile set of standard libraries which come bundled in but are not included right away. See [Standard libraries overview](/ref/standard-libraries).

:::caution

  All imported code is combined together with yours, so it's important to avoid name collisions and always double-check the sources!

:::

## Import Tact code

It's possible to import any Tact code using the `import{:tact}` statement by providing a relative path to the target `.tact` file like so:

```tact
import "./relative/path/to/the/target/tact/file.tact";
```

Specifying parent directories (`../`) is also possible:

```tact
import "../subfolder/imported/file.tact";
```

## Import FunC code

It's possible to import code written in FunC directly, just as it's done with Tact code imports:

```tact
// Relative import
import "./relative/path/to/the/target/func/file.fc";

// Specifying parent directories
import "../subfolder/imported/func/file.fc";
```

However, in order to use functions from such files, one has to declare them as [`native{:tact}` functions](/book/functions#native) first. For example, when the standard library [`@stdlib/dns`](/ref/stdlib-dns) uses a `dns.fc` FunC file, it maps FunC functions to Tact ones like so:

```tact
// FunC code located in a file right next to the current Tact one:
import "./dns.fc";

// Mapping function signatures from FunC to Tact:
@name(dns_string_to_internal)
native dnsStringToInternal(str: String): Slice?;
```

## Standard libraries

See [Standard libraries overview](/ref/standard-libraries).
