# Introducing Effect UI

Published Nov 26, 2026 · Updated Nov 27, 2026

Effect UI is a frontend library built on Effect and the Elm Architecture. Build web, terminal and native apps from self-contained Components with explicit state transitions and side effects as values, plus DevTools built for humans and agents.

Effect UI is in public preview. We built this page with it, and you can [read its source](https://github.com/Effect-TS/ui/tree/main/examples/launch) on GitHub.

## Why Effect UI

Frontend apps get hard for the same reasons everywhere: tangled state, race conditions in async work and side effects scattered across callbacks. Effect UI puts every state transition in one pure function and handles async work, cancellation and errors with Effect. If you also use Effect on the server, the same programming model carries across the whole stack.

Like Effect itself, Effect UI and Effect UI Kit have zero third-party runtime dependencies. Typed routing, a query cache, shared state, server rendering, DevTools, testing harnesses and 52 headless UI modules all come built in, so you don't have to assemble a frontend stack out of half a dozen packages.

## Components

**A Component is a mini Elm Architecture program, and you build an app by composing Components.** Each Component defines its own Model, Messages, update and view. Messages go straight to their Component's update and re-render only that Component.

Every Component has a Model, an update and a view of its own. Root renders A, and A renders A1 and A2. Props flow down and events flow up.

A Component is self-contained, so you can write, test and lazy-load it on its own, and provide its own services. If a Component fails, the rest of the app keeps running.

### Anatomy of a Component

This counter shows the core parts of a Component. One definition holds its Model, Messages, init, update, subscriptions and view.

`Counter.ts`

```ts
import { Command, Subscription, UiSchema } from "@effect/ui"
import { Button } from "@effect/ui-kit"
import { Html } from "@effect/ui/html"
import { Effect, Schema, Stream } from "effect"

// A Schema union with a constructor for each Message. A Message's
// fields are its payload: ClickedAdd carries the amount to add.
export const CounterMessage = UiSchema.TaggedEnum({
  ClickedAdd: { amount: Schema.Number },
  ClickedResetAfterDelay: {},
  CompletedDelayReset: {},
  ClickedToggleAutoCount: {},
  Ticked: {}
})

// Defines a Command: its name, its options (no args here) and its
// body. DelayReset.make() creates one to run, and the Message its
// Effect returns goes to update.
export const DelayReset = Command.make(
  "DelayReset",
  {},
  () =>
    Effect.sleep("1 second").pipe(
      Effect.as(CounterMessage.CompletedDelayReset())
    )
)

// Html.component defines a Component whose view builds HTML
// elements, such as h.div.
export const Counter = Html.component({
  name: "Counter",
  model: Schema.Struct({
    count: Schema.Number,
    isAutoCounting: Schema.Boolean
  }),
  message: CounterMessage
}).make({
  init: () => ({ count: 0, isAutoCounting: false }),
  // A handler per Message. $ holds the current Model and builds
  // the result: $.evolve changes the fields it names, and $.run
  // issues a Command.
  update: {
    // The Message's payload is the handler's second argument.
    ClickedAdd: ($, { amount }) =>
      $.evolve({ count: (count) => count + amount }),
    // Runs the Command without changing the Model. To do both,
    // chain them: $.evolve({ ... }).run(...).
    ClickedResetAfterDelay: ($) => $.run(DelayReset.make()),
    CompletedDelayReset: ($) => $.evolve({ count: 0 }),
    ClickedToggleAutoCount: ($) =>
      $.evolve({
        isAutoCounting: (isAutoCounting) => !isAutoCounting
      }),
    Ticked: ($) => $.evolve({ count: (count) => count + 1 })
  },
  // Called on mount and after each update. A Subscription's
  // Stream runs while its key, "tick", is listed, and each value
  // it emits is sent as a Message. A false entry is skipped.
  subscriptions: ({ model }) => [
    model.isAutoCounting &&
    Subscription.make(
      "tick",
      Stream.tick("1 second").pipe(
        // Stream.tick emits once at the start. Skip that one.
        Stream.drop(1),
        Stream.map(() => CounterMessage.Ticked())
      )
    )
  ],
  view: (h, model) =>
    h.div.class("counter").children(
      h.output.class("counter-value").children(String(model.count)),
      // Button is a view function from the UI kit, not a Component.
      // It returns a <button> builder, and a press sends onPress.
      Button(h, {
        onPress: CounterMessage.ClickedAdd({ amount: -1 })
      })
        .class("counter-button counter-add")
        .children("−1"),
      Button(h, { onPress: CounterMessage.ClickedAdd({ amount: 1 }) })
        .class("counter-button counter-add")
        .children("+1"),
      Button(h, {
        props: {
          // h.isRunning is true while a DelayReset Command is
          // running. The runtime tracks that, so the Model doesn't
          // need a flag for it.
          disabled: h.isRunning(DelayReset),
          // Keeps keyboard focus on the button while it's disabled.
          focusableWhenDisabled: true
        },
        onPress: CounterMessage.ClickedResetAfterDelay()
      }).class("counter-button counter-reset").children(
        h.isRunning(DelayReset) ? "Resetting" : "Reset in 1 second"
      ),
      Button(h, { onPress: CounterMessage.ClickedToggleAutoCount() })
        .class(
          "counter-button",
          model.isAutoCounting ? "counter-stop" : "counter-start"
        ).children(model.isAutoCounting ? "Stop" : "Auto-count")
    )
})
```

Click "+1", then click the Effect UI button in the bottom-right corner. [DevTools](#devtools) lists the Message you sent and what it changed.

### Composing Components

This example builds a `Page` that shows or hides a `Counter`.

`Page.ts`

```ts
import { UiSchema } from "@effect/ui"
import { Html } from "@effect/ui/html"
import { Schema } from "effect"
import { Counter } from "./Counter.ts"

const PageMessage = UiSchema.TaggedEnum({
  ClickedToggleCounter: {}
})

export const Page = Html.component({
  name: "Page",
  model: Schema.Struct({ isCounterShown: Schema.Boolean }),
  message: PageMessage
}).make({
  init: () => ({ isCounterShown: true }),
  update: {
    ClickedToggleCounter: ($) => ({
      isCounterShown: !$.model.isCounterShown
    })
  },
  view: (h, model) =>
    h.div.class("counter-page").children(
      h.button
        .on("click", PageMessage.ClickedToggleCounter())
        .children(
          model.isCounterShown ? "Hide counter" : "Show counter"
        ),
      // Calling a Component in the view renders it as a child. The
      // runtime holds its Model until the view stops rendering it.
      // To render two Counters here, give each one a key.
      model.isCounterShown &&
        Counter(h, { props: { label: "Likes" } })
    )
})
```

`Counter.ts`

```ts
import { UiSchema } from "@effect/ui"
import { Html } from "@effect/ui/html"
import { Schema } from "effect"

const CounterMessage = UiSchema.TaggedEnum({
  ClickedDecrement: {},
  ClickedIncrement: {}
})

export const Counter = Html.component({
  name: "Counter",
  // What the parent passes in. init and update read it as $.props
  // and view as h.props.
  props: Schema.Struct({ label: Schema.String }),
  model: Schema.Struct({ count: Schema.Number }),
  message: CounterMessage
}).make({
  init: () => ({ count: 0 }),
  update: {
    // A handler can also return the next Model as a plain value.
    ClickedDecrement: ($) => ({ count: $.model.count - 1 }),
    ClickedIncrement: ($) => ({ count: $.model.count + 1 })
  },
  view: (h, model) =>
    h.div.class("counter").children(
      h.span.class("counter-label").children(h.props.label),
      h.button
        .class("counter-button")
        .attr("aria-label", "Decrement")
        .on("click", CounterMessage.ClickedDecrement())
        .children("-"),
      h.output.class("counter-value").children(String(model.count)),
      h.button
        .class("counter-button")
        .attr("aria-label", "Increment")
        .on("click", CounterMessage.ClickedIncrement())
        .children("+")
    )
})
```

## DevTools

Effect UI has an inspector you can add with one Layer, `DevTools.layer`, or automatically in dev with `DevToolsVite.plugin`. It's running on this page, behind the Effect UI button in the bottom-right corner.

- **Timeline:** One list holds every Message from every Component, the Model after it and what changed.
- **Cause and effect:** For any entry, DevTools traces what sent the Message, the Commands it issued and how each one ended.
- **Element picker:** Click **Pick** to select any element on the page and jump to the Component instance that rendered it. Try it on this page.
- **Noise control:** Stop or resume recording noisy Message tags at runtime without editing code, and surface or filter declared payload fields in the timeline.
- **Time travel:** Pick an earlier entry to see the page at that point. The live app keeps running, and Resume returns to it.
- **For agents:** An MCP server (or WebMCP in the browser) lets agents read the log, inspect Component state and, if allowed, send Messages.

Terminal apps built with `@effect/ui-opentui` can stream their logs into the same browser inspector with `DevToolsHeadless.layer`.

## Testing

### Play tests

**A Play test runs a whole user flow without a browser, module mocks or real timers.** It mounts a Component and its children on the [test host](#web-terminal-and-native), clicks through the UI, runs real Commands, Subscriptions and Query fetches against in-memory Layers, and checks what's on screen afterwards.

`TestClock` controls time, so delayed flows run instantly.

`Counter.play.test.ts`

```ts
import { HtmlLocator, HtmlPlay } from "@effect/ui/html/testing"
import { it } from "@effect/vitest"
import { Effect } from "effect"
import { TestClock } from "effect/testing"
import { Counter } from "./Counter.ts"

const count = HtmlLocator.role("status")
const addOne = HtmlLocator.role("button", { name: "+1" })
const reset = HtmlLocator.role("button", {
  name: "Reset in 1 second"
})

it.effect("resets one second after the click", () =>
  Effect.gen(function*() {
    // Mounts Counter on the test host. After each step, the test
    // waits for the app to finish reacting, so the next line sees
    // the result.
    const play = yield* HtmlPlay.make(Counter, {})
    yield* play.click(addOne)
    yield* play.click(reset)
    yield* TestClock.adjust("999 millis")
    yield* play.expect(count).toHaveText("1")
    yield* TestClock.adjust("1 millis")
    yield* play.expect(count).toHaveText("0")
  }))
```

An interactive figure runs this test in the browser, on the test host with a TestClock. A slider steps through it one line at a time and shows the app as the test host holds it, the TestClock and whether DelayReset is running. The test clicks +1 and Reset, so the count is 1 and DelayReset is asleep. It advances the clock to 999 ms, and the count is still 1. It advances the clock one more millisecond. DelayReset finishes, the runtime delivers CompletedDelayReset, and the count is 0.

`App.play.test.ts`

```ts
import type { Session } from "#domain/Session"
import { Router } from "@effect/ui"
import { HtmlLocator, HtmlPlay } from "@effect/ui/html/testing"
import { Locator, TestHost } from "@effect/ui/testing"
import { assert, it } from "@effect/vitest"
import { Effect, Layer, Option } from "effect"
import { KeyValueStore } from "effect/persistence"
import { TestClock } from "effect/testing"
import { App, appProps } from "./App.ts"
import { SessionStore } from "./auth/services/SessionStore.ts"
import { AppRoute } from "./routes.ts"

const alice: Session = {
  userId: "1",
  email: "alice@example.com",
  name: "alice"
}

const AppTest = (url: string) =>
  Layer.mergeAll(
    Router.memory({ routes: AppRoute, url }),
    SessionStore.layer.pipe(Layer.provide(KeyValueStore.layerMemory)),
    TestHost.layer()
  )

const storedSession = SessionStore.use((store) => store.get)

const currentUrl = Effect.map(Router.Router, (router) => router.location().url)

it.effect("a successful login saves the session and lands on the dashboard", () =>
  Effect.gen(function*() {
    const play = yield* HtmlPlay.make(App, appProps)
    yield* play.type(HtmlLocator.label("Email"), alice.email)
    yield* play.type(HtmlLocator.label("Password"), "password")
    yield* play.click(HtmlLocator.role("button", { name: "Sign In" }))
    yield* TestClock.adjust("1 second")
    yield* play.expect(Locator.text("Welcome back, alice!")).toExist()
    assert.deepStrictEqual(yield* storedSession, Option.some(alice))
    assert.strictEqual(yield* currentUrl, "/dashboard")
  }))
```

A second tab runs this test of the sign-in flow in `examples/auth`. The router and the session store keep their data in memory. The test types an email and a password, and the form enables its button. It clicks Sign In. The real sign-in Command starts a request that takes one second, and the button reads "Signing in...". It advances the clock one second. The app shows the dashboard, the session is in the store and the URL is /dashboard.

`SnakeGame.play.test.ts`

```ts
import { HtmlPlay } from "@effect/ui/html/testing"
import { Locator } from "@effect/ui/testing"
import { it } from "@effect/vitest"
import { Effect, Random } from "effect"
import { TestClock } from "effect/testing"
import { SnakeGame } from "./SnakeGame.ts"

const scored = Locator.text("Score: 10")
const paused = Locator.text("Paused - SPACE to continue")

it.effect("steers to the apple, eats it and pauses", () =>
  Effect.gen(function*() {
    // The seed below puts the first apple one row up from the snake
    // and six cells to its right. The snake moves every 150 ms.
    const play = yield* HtmlPlay.make(SnakeGame, {})
    yield* play.keydown("document", " ")
    yield* play.keydown("document", "ArrowUp")
    yield* TestClock.adjust("150 millis")
    yield* play.keydown("document", "ArrowRight")
    yield* TestClock.adjust("900 millis")
    yield* play.expect(scored).toExist()
    yield* play.keydown("document", " ")
    yield* TestClock.adjust("10 seconds")
    yield* play.expect(paused).toExist()
  }).pipe(Random.withSeed("e")))
```

A third tab runs this test of the Snake game in `examples/snake`. A seed fixes where the apple appears. The test presses Space to start the game and the up arrow to turn, then advances the TestClock 150 ms, which is one move. It presses the right arrow and advances the clock 900 ms, which is six moves. The snake reaches the apple and the score is 10. It presses Space to pause and advances the clock ten seconds, and the snake doesn't move.

### Story and Scene tests

To test one Component in isolation without running its Commands, a Story test sends Messages straight to `update`, and a Scene test drives it through the view. Both start from the Component's init Model or a state you supply with `given`, and resolve each Command by hand.

`Counter.story.test.ts`

```ts
import { Story } from "@effect/ui/testing"
import { assert, it } from "@effect/vitest"
import { Effect } from "effect"
import { Counter, CounterMessage, DelayReset } from "./Counter.ts"

it.effect("resets after the delay", () =>
  Effect.gen(function*() {
    // {} is Counter's props. Each step runs when it is called and
    // returns story, so the steps chain. story.model is the Model
    // after the last one.
    const story = yield* Story.make(Counter, {})
    story.given({ count: 5, isAutoCounting: false })
      .send(CounterMessage.ClickedResetAfterDelay())
      .expectExact(DelayReset)
      .resolve(DelayReset, CounterMessage.CompletedDelayReset())
    assert.strictEqual(story.model.count, 0)
  }))
```

`Counter.scene.test.ts`

```ts
import { HtmlLocator, HtmlScene } from "@effect/ui/html/testing"
import { it } from "@effect/vitest"
import { Effect } from "effect"
import { Counter, CounterMessage, DelayReset } from "./Counter.ts"

const count = HtmlLocator.role("status")
const reset = HtmlLocator.role("button", {
  name: "Reset in 1 second"
})

it.effect("resets after the delay", () =>
  Effect.gen(function*() {
    const scene = yield* HtmlScene.make(Counter, {})
    scene.given({ count: 5, isAutoCounting: false })
      .click(reset)
      .expectExact(DelayReset)
      // Until the test resolves DelayReset, the Command counts as
      // running, so the button reads "Resetting".
      .expect(HtmlLocator.role("button", { name: "Resetting" }))
      .toExist()
      .resolve(DelayReset, CounterMessage.CompletedDelayReset())
      .expect(count).toHaveText("0")
  }))
```

A test can also supply test values for everything around the Component: a Query's result, a Subscription's value, an event from a child, a Provider's value or new props from the parent.

`Story.check` runs property tests over Message and Command sequences generated from a Component's Schemas, shrinking any failure to minimal Story steps. For concurrency bugs, `Story.explore` exhaustively searches overlapping Message and Command settlement orders and reports the shortest failing path.

## Effect UI Kit

**`@effect/ui-kit` ships 52 modules**, so you don't have to build accessible UI from scratch. Each handles keyboard, focus and ARIA while you write the markup and styles, and you can build your own headless Components the same way.

Of those, 46 are headless components and 5 are lower-level primitives: `Dismissal`, `ListNavigation`, `Positioning`, `Typeahead` and `VirtualKeyboard`. The kit covers every component in [Base UI](https://base-ui.com/), plus `Calendar`, `RangeCalendar`, `DateField`, `DatePicker`, `FileDrop`, `SortableList`, `NavigationLinks`, `VirtualList` and `DirectionProvider`.

Here are all 52 modules. Hover or tap to animate.

Modules: Accordion, AlertDialog, Autocomplete, Avatar, Button, Calendar, Checkbox, CheckboxGroup, Collapsible, Combobox, ContextMenu, DateField, DatePicker, Dialog, DirectionProvider, Dismissal, Drawer, Field, Fieldset, FileDrop, Form, Input, ListNavigation, Menu, Menubar, Meter, NavigationLinks, NavigationMenu, NumberField, OTPField, Popover, Positioning, PreviewCard, Progress, RadioGroup, RangeCalendar, ScrollArea, Select, Separator, Slider, SortableList, Switch, Tabs, Toast, Toaster, Toggle, ToggleGroup, Toolbar, Tooltip, Typeahead, VirtualKeyboard, VirtualList.

## Data and state

### Data fetching with Queries

**Define a Query once and list it on the Components that need it.** The runtime fetches the data, shares one cache across every Component and keeps loading and error states out of your Model.

- **Fetching:** Fetches on render and when arguments change, interrupting superseded fetches. Supports `debounce` and keeps the last result on screen.
- **Caching:** The runtime keeps one result per Query and arguments. Components that ask for the same data share one fetch.
- **Freshness:** A result older than `staleTime` stays on screen while the runtime refetches it.
- **States:** Each result is an `AsyncResult`: either no result yet, failure or success.

For live data such as WebSockets or server-sent events, `Query.StreamService` backs a Query entry with a shared `Stream`: each emitted value updates the cached result, and the stream closes when nothing watches it.

Also built into Queries: polling, refetch on focus and reconnect, load more, invalidation from Commands, optimistic updates, prefetch on link hover, server rendering, restore on back and forward.

`Posts.ts`

```ts
import { Component, Query, UiSchema } from "@effect/ui"
import { Html } from "@effect/ui/html"
import { Effect, Schema } from "effect"
import { AsyncResult } from "effect/reactivity"
import { Post, PostsApi } from "../Posts.ts"

// A query caches one result per args; attach its fetcher with `toLayer`.
export class SearchPosts extends Query.Service<SearchPosts>()(
  "SearchPosts",
  {
    args: { search: Schema.String },
    success: Schema.Array(Post),
    error: Schema.String,
    // Stale entries refetch on next use.
    staleTime: "1 minute"
  }
) {
  static readonly layer = this.toLayer(
    Effect.gen(function*() {
      const api = yield* PostsApi
      return ({ search }) => api.search(search)
    })
  )
}

export const PostsMessage = UiSchema.TaggedEnum({
  UpdatedSearch: { search: Schema.String }
})

export const Posts = Html.component({
  name: "Posts",
  model: Schema.Struct({ search: Schema.String }),
  message: PostsMessage,
  queries: {
    posts: {
      query: SearchPosts,
      // The query's args, derived from the Model when it changes.
      args: ({ model }) => ({ search: model.search }),
      // New args wait this long before they fetch, and newer args
      // restart the wait. A fresh cached result is shown at once.
      debounce: "300 millis"
    }
  }
}).make({
  init: () => ({ search: "" }),
  update: { UpdatedSearch: ($, { search }) => $.evolve({ search }) },
  view: (h, model) =>
    h.div.children(
      h.input.attr("aria-label", "Search posts").value(model.search)
        .on("input", ({ value }) =>
          PostsMessage.UpdatedSearch({ search: value })),
      AsyncResult.match(h.queries.posts, {
        onInitial: () =>
          h.p.children("Loading posts"),
        onFailure: () => h.p.children("Could not load posts"),
        // waiting covers both a refetch and a changed search, including debounce.
        onSuccess: ({ value, waiting }) =>
          h.ul.attr("aria-busy", String(waiting)).children(
            value.map((post) =>
              h.li.key(post.id).children(post.title)
            )
          )
      })
    )
  // SearchPosts.layer needs PostsApi, which the app provides.
}).pipe(Component.provide(SearchPosts.layer))
```

### Shared state with Providers

A Provider shares part of its Model with Components inside it, at any depth. Components inside read that state and send the Provider Messages directly, without passing props or callbacks through the parents in between.

`CartProvider.ts`

```ts
import { UiSchema } from "@effect/ui"
import { Html } from "@effect/ui/html"
import { Schema } from "effect"

export const CartMessage = UiSchema.TaggedEnum({
  RequestedAddItem: {}
})

export const CartProvider = Html.component({
  name: "CartProvider",
  model: Schema.Struct({ count: Schema.Number }),
  message: CartMessage,
  // value is what the Components inside the Provider read. receives
  // lists the Messages they may send it with $.send.
  shares: {
    value: ({ model }) => ({ count: model.count }),
    receives: ["RequestedAddItem"]
  }
}).make({
  init: () => ({ count: 0 }),
  update: {
    RequestedAddItem: ($) => $.evolve({ count: $.model.count + 1 })
  }
})
```

`Shop.ts`

```ts
import { UiSchema } from "@effect/ui"
import { Html } from "@effect/ui/html"
import { Schema } from "effect"
import { CartMessage, CartProvider } from "./CartProvider.ts"

export const Shop = Html.component({
  name: "Shop",
  // Shop has no state and no Messages.
  model: Schema.Null,
  message: Schema.Never
}).make({
  init: () => null,
  update: ($) => $.model,
  view: (h) =>
    CartProvider(h, {
      // CartProvider draws nothing. Shop passes it this view, and
      // every Component rendered in it, at any depth, is inside the
      // Provider.
      view: () =>
        h.main(
          CartCount(h, {}),
          h.article(h.h3("Notebook"), AddToCart(h, {}))
        )
    })
})

const CartCount = Html.component({
  name: "CartCount",
  model: Schema.Null,
  message: Schema.Never,
  // Lists the Provider to read from.
  reads: { cart: CartProvider }
}).make({
  init: () => null,
  update: ($) => $.model,
  // h.reads.cart holds CartProvider's shared value. CartCount
  // renders again when that value changes.
  view: (h) => h.output(`${h.reads.cart.count} in cart`)
})

const AddToCartMessage = UiSchema.TaggedEnum({ ClickedAdd: {} })

const AddToCart = Html.component({
  name: "AddToCart",
  model: Schema.Null,
  message: AddToCartMessage
}).make({
  init: () => null,
  update: {
    // Sends the Message to the nearest CartProvider above. Sending
    // needs no reads entry.
    ClickedAdd: ($) =>
      $.send(CartProvider, CartMessage.RequestedAddItem())
  },
  view: (h) =>
    h.button.on("click", AddToCartMessage.ClickedAdd())
      .children("Add to cart")
})
```

**A Provider's Model holds the shared value.** Changed by: A1.

1. A click in A1's view produces a Message.
2. A1's update sends a Message to the Provider.
3. The Provider's update changes the value in its Model.
4. A1 and A2 read the value, so their views run again.

## Web, terminal and native

Effect UI renders through a host instead of tying Components to the browser DOM. From the same HTML Components, the browser host renders DOM nodes, the server host writes HTML and the test host builds an in-memory tree.

**A Component works the same on every platform.** Only the platform-specific pieces change: the view elements, the host you mount onto and the effects that interact with them. For example, `Html.component` and `HtmlCommand.focus` target the web, `OpenTui.component` and `OpenTuiCommand.focus` in `@effect/ui-opentui` target the terminal, and `Native.component` in `@effect/ui-native` renders React Native views directly through Fabric without React. The host interface is public if you want to build your own.

## Performance

In [js-framework-benchmark](https://github.com/krausest/js-framework-benchmark), Effect UI took 4.12× as much JavaScript time as vanilla JavaScript across nine operations (geometric mean). On the same machine, the Effect UI benchmark app reached first paint in 381 ms and used 4.1 MB of memory with 1,000 rows.

| Entry | JavaScript time, as a multiple of vanilla JavaScript |
| --- | ---: |
| Vanilla JS | 1.00× |
| Solid | 1.87× |
| Svelte | 2.41× |
| Vue | 3.75× |
| Effect UI | 4.12× |
| React | 6.44× |

**Median time running JavaScript per operation**

| Workload | Vanilla JS | Effect UI | React | Vue | Svelte | Solid |
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| Create 1,000 rows | 6.9 ms | 23.3 ms | 23.6 ms | 22.9 ms | 11.5 ms | 10.1 ms |
| Replace 1,000 rows | 15.4 ms | 32.0 ms | 41.3 ms | 33.3 ms | 22.6 ms | 21.3 ms |
| Update every 10th row | 1.1 ms | 16.1 ms | 12.9 ms | 7.3 ms | 3.4 ms | 2.8 ms |
| Select a row | 0.8 ms | 6.9 ms | 8.4 ms | 3.4 ms | 7.3 ms | 2.7 ms |
| Swap two rows | 0.6 ms | 6.3 ms | 62.3 ms | 3.8 ms | 4.7 ms | 3.3 ms |
| Remove a row | 1.0 ms | 3.1 ms | 3.6 ms | 8.5 ms | 1.7 ms | 1.1 ms |
| Create 10,000 rows | 68.8 ms | 181 ms | 422 ms | 203 ms | 101 ms | 93.7 ms |
| Append 1,000 rows | 7.3 ms | 25.2 ms | 25.7 ms | 22.3 ms | 12.7 ms | 10.6 ms |
| Clear 1,000 rows | 30.9 ms | 40.0 ms | 64.3 ms | 46.5 ms | 36.1 ms | 40.6 ms |

**Page load and memory**

| Workload | Vanilla JS | Effect UI | React | Vue | Svelte | Solid |
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| Compressed size | 2.5 kB | 52.8 kB | 51.4 kB | 23.3 kB | 9.7 kB | 4.5 kB |
| First paint | 64.8 ms | 381 ms | 419 ms | 154 ms | 106 ms | 68.2 ms |
| Memory after load | 0.6 MB | 1.2 MB | 1.2 MB | 0.9 MB | 0.7 MB | 0.6 MB |
| Memory with 1,000 rows | 1.9 MB | 4.1 MB | 4.4 MB | 3.9 MB | 2.9 MB | 2.7 MB |

## Also included

- **Typed routing:** Define routes with Schema-typed path and search params in `Route`, then back navigation with `BrowserRouter.layer` in the browser, `Router.static` on the server and `Router.memory` in tests.
- **Services per Component:** `Component.provide` gives services to a Component and everything below it. Its Commands and Subscriptions use them, and TypeScript reports a missing service at compile time.
- **Code splitting:** Load a Component from a chunk of its own with `Component.lazy`. The browser loads the chunk the first time the Component renders, so it stays out of the initial bundle.
- **Control overlapping Commands:** When an update issues a Command that is still running, use `concurrent` to run both, `switch` to interrupt the earlier run or `queue` to wait for it.
- **Full-stack SSR and prerendering:** `HtmlServerVite.plugin` renders pages on the server in `vite dev`, prerenders static routes in `vite build` and can emit a production web handler. This page uses it.
- **Incremental adoption:** Mount any Component into an existing DOM node, publish it as a custom element with `BrowserHost.defineElement`, or consume third-party Web Components with `Html.customElement`.

## Try a snapshot build

Effect UI isn't on npm yet. Every commit to `main` is published as a snapshot build on [pkg.pr.new](https://pkg.pr.new/~/Effect-TS/ui). To install the latest one:

```sh
pnpm add effect \
  @effect/ui@https://pkg.pr.new/Effect-TS/ui/@effect/ui@main \
  @effect/ui-kit@https://pkg.pr.new/Effect-TS/ui/@effect/ui-kit@main
```

To stay on one build, replace `main` with a commit's short SHA. Snapshots of `@effect/ui-devtools`, `@effect/ui-opentui` and `@effect/ui-native` are published the same way, with install commands under [Snapshots](https://github.com/Effect-TS/ui#snapshots) in the README. You can ignore pnpm's unmet `@effect/ui` peer warning: the packages still use the snapshots you installed.

To start a new app from Vite's `vanilla-ts` template, follow [Start a new app](https://github.com/Effect-TS/ui#start-a-new-app). `@effect/ui` ships its guide as `node_modules/@effect/ui/AGENTS.md`, so point your coding agent's instructions at that file.

The [examples](https://github.com/Effect-TS/ui/tree/main/examples) in the repository are complete apps you can read and run, including [`domains`](https://github.com/Effect-TS/ui/tree/main/examples/domains) (a server-rendered domain search app with a shared `HttpApi`) and [`native`](https://github.com/Effect-TS/ui/tree/main/examples/native) (an Expo app running on `@effect/ui-native`).

## What happens next

- **Public preview:** Effect UI is still experimental, and we're sharing it early so you can try the APIs and help shape them. Open issues and PRs in [Effect-TS/ui](https://github.com/Effect-TS/ui).
- **Toward full-stack Effect:** We're building toward a full-stack Effect framework on the same zero-dependency core, where your database, HTTP and RPC APIs, auth, background work, observability and UI share one programming model. Server rendering and prerendering with a shared `HttpApi` already work today.
- **Moving into the Effect monorepo:** Effect UI lives in its own repository while the APIs settle. Once it's ready, we plan to move it into the main Effect monorepo and version and release it in lockstep with Effect.
- **Coming from Foldkit 0.x?** [Foldkit 0.x](https://foldkit.dev) will keep getting critical bug fixes until Effect UI ships with an upgrade guide, and the migration will be an upgrade, not a rewrite. Relevant issues and PRs will move to `Effect-TS/ui` ([read the announcement](https://foldkit.dev/blog/foldkit-joins-effect)).

We built this page with Effect UI. [Read the source](https://github.com/Effect-TS/ui/tree/main/examples/launch) in `examples/launch` in Effect-TS/ui.
