# Playgrounds

> Create AI-generated playgrounds, interactive pages built from your description or a course, then set their access, publish them and embed them in lessons.

A playground is an interactive web page (a simulation, a visualization, a small game or exercise) that AI writes from your description. You publish it on its own page, outside any course. It is not a code runner: for runnable code exercises use the [Code Playground block](https://docs.learnhouse.app/platform/code-execution).

> Playgrounds must be enabled in your [Organization Settings](https://docs.learnhouse.app/platform/organizations/settings), and AI must be set up on the instance (see [AI Setup](https://docs.learnhouse.app/self-hosting/configuration/ai-setup)). On LearnHouse Cloud, playgrounds are available on the Personal, Pro and Enterprise plans, but not on Free or Standard.
> 

## Creating a playground

1. Go to **Playgrounds** in the dashboard and click **New Playground**. Give it a name and click **Create**. The playground editor opens.
2. In the **AI Generator** panel, choose a **Source**:
- **AI Knowledge**: the AI works from general knowledge.
- **Course**: pick one of your courses, and its content is given to the AI as context.
3. Describe what you want and click **Send**. The result appears in the preview.
4. Ask for changes in the same chat. You can generate up to 10 times per editing session. The counter shows how many generations are left.
5. Click **Save**, then **Publish** when it is ready for learners.

<img src="/img/pages/playgrounds/playground-editor.webp" alt="The playground editor with a generated payout date calculator in the preview and the AI Generator chat on the right" width={1600} height={900} style={{ borderRadius: 10 }} />

Each generation uses 3 [AI credits](https://docs.learnhouse.app/platform/ai#ai-credits).

## Options

Open the playground's options to change:

| Tab | Settings |
| --- | --- |
| **General** | Name and description. |
| **Access** | **Public** (anyone on the internet), **Members only** (signed-in members of your organization, the default) or **Restricted** (only the user groups you pick). |
| **Thumbnail** | Upload a PNG or JPG image (up to 8 MB), or generate one with AI. |

<img src="/img/pages/playgrounds/playground-access.webp" alt="The Access tab of a playground's options, with Public, Members only and Restricted" width={1600} height={900} style={{ borderRadius: 10 }} />

Unpublished playgrounds stay as **Draft** and only editors can see them.

## The playground page

Learners open a published playground from the **Playgrounds** page. They can use it inline or in **Fullscreen**, and react with emoji under **Reactions**. The page also shows the author, access level and creation date. **Download** saves the playground as a single `.html` file.

<img src="/img/pages/playgrounds/playground-page.webp" alt="A published playground page, with its details and reactions on the left and the playground on the right" width={1600} height={900} style={{ borderRadius: 10 }} />

From the dashboard list you can also duplicate, delete or download several playgrounds at once.

## Using a playground in a course

To put a playground inside a lesson, add a **Library** block to a Dynamic Page, open its **Playgrounds** tab and choose your playground. It runs right inside the page. See [Blocks](https://docs.learnhouse.app/platform/editor/blocks).

<img src="/img/pages/playgrounds/playground-in-lesson.webp" alt="A lesson with a playground embedded through a Library block" width={1600} height={900} style={{ borderRadius: 10 }} />

Playgrounds can also be sold as a [product](https://docs.learnhouse.app/platform/payments/offers). Until someone buys it, they see its page but cannot use it.

## Playgrounds, Magic Blocks and Code Playground

| Feature | Where it lives | What it is |
| --- | --- | --- |
| **Playgrounds** (this page) | Its own page, listed under Playgrounds, or in a lesson through a Library block | AI-generated interactive page |
| **Magic Block** | Inside a course page, from the `/` menu | AI-generated interactive element embedded in a lesson. See [Blocks](https://docs.learnhouse.app/platform/editor/blocks). |
| **AI Playground** on a board | On a [board](https://docs.learnhouse.app/platform/boards) | AI-generated interactive element on a canvas |
| **Code Playground** | Inside a course page, from the `/` menu | A coding challenge that runs real code. See [Code Execution](https://docs.learnhouse.app/platform/code-execution). |
