# Refract > Refract is a Rust UI framework with typed views, reactive state, a browser DOM adapter, and a native adapter. Refract separates view composition and reactive state from platform rendering. Shared Rust views run through browser and native adapters. These guides cover application setup, state management, layout, effects, and the underlying architecture. The website's interactive counter is a real Refract app compiled from Rust to WebAssembly. Its source is in www/counter/. The guides contain Rust examples and instructions for building your own apps. ## Start Here - [Getting Started](https://refract.rs/docs/getting-started/index.md): Your first Refract view, from a few lines of Rust to a running application. ## For Agents - [Overview](https://refract.rs/docs/for-agents-overview/index.md): Copy this Markdown into an agent prompt or your project's `AGENTS.md`. - [Porting to Refract](https://refract.rs/docs/porting-to-refract/index.md): Copyable instructions for migrating an existing application while preserving its behavior and platform requirements. ## Guides - [Views](https://refract.rs/docs/views/index.md): Compose typed views and preserve their mounted identities. - [Layout & Style](https://refract.rs/docs/layout-style/index.md): Build layouts with stacks, then make them yours with composable modifiers. - [Reactivity](https://refract.rs/docs/reactivity/index.md): Read and update reactive state, and share values throughout the view tree. - [Input & Focus](https://refract.rs/docs/input-focus/index.md): Handle input, bind focus to state, and style focused controls and containers on web and native. - [Effects](https://refract.rs/docs/effects/index.md): Tie external work to mounted lifetimes with explicit dependencies and cleanup. - [Channels](https://refract.rs/docs/channels/index.md): Deliver async and background results to reactive state on web and native. - [Animation](https://refract.rs/docs/animation/index.md): Animate state changes and view transitions with shared timing on desktop and web. - [Canvas](https://refract.rs/docs/canvas/index.md): Build portable vector illustrations with shapes, paths, reactive canvas inputs, and animation. - [Shaders](https://refract.rs/docs/shaders/index.md): Render application-owned WGSL with reactive uniforms, image inputs, and animation on native GPUs and WebGPU. - [Macros](https://refract.rs/docs/macros/index.md): Declare views, state, actions, effects, and environment reads with Refract’s authoring attributes. - [Architecture](https://refract.rs/docs/architecture/index.md): How the reactive graph, mounted view tree, and platform hosts turn shared Rust views into incremental UI updates. - [Internal Types](https://refract.rs/docs/internal-types/index.md): How typed builders, View, Element, and the mounted runtime fit together. - [Graph](https://refract.rs/docs/graph/index.md): How Refract tracks dependencies and turns a state change into a host update. - [Native Rendering](https://refract.rs/docs/native-rendering/index.md): How the native host turns retained elements into layout, drawing commands, and incrementally rendered pixels. - [Text Editing](https://refract.rs/docs/text-editing/index.md): How core and the platform hosts synchronize text, selection, formatting, and composition in retained editors. - [Surface](https://refract.rs/docs/surface/index.md): How host observations and ordered requests use the attribute graph without adding a separate reactive runtime. - [Async Work](https://refract.rs/docs/async-work/index.md): How background results enter the UI thread, propagate through the graph, and follow mounted lifetimes. ## Reference - [Overview](https://refract.rs/docs/reference-overview/index.md): Choose a primitive, layout helper, or drawing API, then configure its view-specific and shared modifiers. - [View Modifiers](https://refract.rs/docs/view-modifiers/index.md): Configure views with shared modifiers and concrete canvas, shader, shape, text, and image methods. - [Browser & Native](https://refract.rs/docs/browser-native/index.md): Mount or prerender a browser app, pass reactive inputs from its host, run shared views in a native window, and read the host surface. ## Primitives - [view](https://refract.rs/docs/view/index.md): Create a basic box for styling, semantics, or interaction. - [text](https://refract.rs/docs/text/index.md): Display a string with typography, wrapping, and semantic labels. - [image](https://refract.rs/docs/image/index.md): Display an image from a URL, file path, or embedded asset. - [field](https://refract.rs/docs/field/index.md): Edit a single-line or multiline string through a binding. - [fragment](https://refract.rs/docs/fragment/index.md): Group a sequence of views without adding a host element. ## Layout - [stack](https://refract.rs/docs/stack/index.md): Arrange children with a configurable horizontal or vertical direction. - [h_stack](https://refract.rs/docs/h-stack/index.md): Arrange children horizontally with spacing and alignment. - [v_stack](https://refract.rs/docs/v-stack/index.md): Arrange children vertically with spacing and alignment. - [z_stack](https://refract.rs/docs/z-stack/index.md): Layer children in shared bounds. - [spacer](https://refract.rs/docs/spacer/index.md): Consume remaining space inside a row or column. - [scroll_view](https://refract.rs/docs/scroll-view/index.md): Place content in a viewport with initial positioning, following, and scroll observation. ## Composition