# Documentation components

Reusable components for clear, interactive Wago documentation. All components support keyboard navigation and narrow screens.

## Tabbed code examples

Use VitePress's built-in code groups for examples in multiple languages or formats.

::: code-group

```go [Go]
engine := wago.NewEngine()
module, err := engine.Compile(wasm)
if err != nil {
  return err
}
```

```wat [WAT]
(module
(func (export "answer") (result i32)
  i32.const 42))
```

```sh [CLI]
wago run module.wasm
```

## Tabbed sections

### Compile

Compile a module once when it will be instantiated more than once.

```go
module, err := engine.Compile(wasm)
```

### Instantiate

Create an isolated instance from the compiled module.

```go
instance, err := module.Instantiate(ctx)
```

### Run

Call an exported WebAssembly function.

```go
results, err := instance.Call(ctx, "answer")
```

Tabs with the same `sync` value remember the reader's choice and stay synchronized across the site.

## Cards

### Get started
  Install Wago and run your first module.

### Configuration
  Learn the available project settings.

### Plugin registry
  Discover runtime extensions and integrations.

### Source code
  Read Wago's implementation on GitHub.

## Steps

### Install Wago

```sh
curl -fsSL https://wago.sh/install.sh | sh
```

### Compile a module

Point Wago at a WebAssembly binary or WAT source file.

### Run it

Execute the module and inspect its result.

## Status badges

stable
experimental
deprecated
nightly

## Accordions

### What is compiled once?

The validated module and native machine code can be reused by multiple isolated instances.

### Does Wago require cgo?

No. Wago is implemented in pure Go.

## API endpoints

### GET /api/packages
List published plugins.

### POST /api/packages/{name}/installs
Record a completed plugin installation.

## Comparisons

## File trees

- `docs/`
  - `.vitepress/`
    - `config.mts`
    - `theme/`

  - `getting-started.md`
  - `reference/`

## Code annotations

```wat
(module
(func (export "answer") (result i32)
  i32.const 42))
```

  The `answer` export is available to the host by name.

  The function returns one 32-bit integer.

  `i32.const` places the value `42` on the operand stack.
