Extending Reddit with Blocks.

Description

Devvit and the Blocks UI framework empower anyone to build Interactive Posts on Reddit—from immersive games to advanced moderation tools—seamlessly extending Reddit's capabilities.

As a "write once, run everywhere" platform, Devvit—and by extension, Blocks—is engineered to be platform-agnostic. The challenge was designing a framework that enable developers to create bespoke, community-driven experiences across a variety of platforms and devices with ease.

My role was to design the underlying structure, components, and their properties that make this possible. We focused on harmonizing mobile and web development, balancing creative freedom with the need for consistency, accessibility, and performance. Through the use of sensible defaults, we deliver simplicity without sacrificing power.

Additionally, by exposing parts of the Reddit Product Language (RPL), we've introduced an abstraction layer that encourages opinionated design, ensuring a consistent and accessible experience across all applications.

By federating the development of Reddit itself, we've set the stage for emergent behavior—enabling the community to build for itself, by itself.

Company

Team

Developer Platform

Category

UI Framework

Interactive Posts

Example apps with Blocks

Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.

Guiding principles

Low Barrier, High Ceiling

Easy for beginners, with room to grow for experts.

Context-Agnostic

Seamlessly adapts across platforms without adjustments.

Composable

Modular components that combine and extend with ease.

Sensible Defaults

Intuitive defaults that work for most, with easy customization.

Lightweight

Fast and smooth, even in resource-constrained environments.

Inclusive

Designed for all users, including those with accessibility needs.

The Blocks.

The Blocks framework borrows concepts of SwiftUI, CSS, and React to create a familiar, easy-to-learn experience for developers of all backgrounds, in line with Jakob's law.

The journey began by identifying the smallest set of primitives needed to build most higher-order components. For composition, we have <hstack>,<vstack>,<zstack>, and <spacer>, and for content, we have <text>, <button>, <icon>, and <image>. By composing these 8 Blocks, you can build almost any interface.

You'll find some details about each below, but for a more in-depth look, check out the Blocks documentation.

Stacks

The stack elements (<vstack>, <hstack>, and <zstack>) are flexible containers used to arrange child elements in different orientations and layers. Stacks can be nested, styled, and clicked if given an onPress handler. Stacks clip any overflowing content.

Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.

Text

The <text> element enables you add and format text in your UI. By default, text blocks are limited to a single line. If you have a lot of text, it grows horizontally and the overflow gets clipped. There are two properties to make working with multi-line text easier: wrap and overflow. For text to wrap onto a new line, there needs to be a width defined.

Extending Reddit with Blocks.Extending Reddit with Blocks.

Icon

The <icon> block includes all icons from the Reddit Product Language (RPL), a curated set of iconography.

Button

The <button> element creates an interactive button that users can click or tap.

Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.

Image

The <image> element is used for embedding images into the UI.

Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.Extending Reddit with Blocks.

Spacer

The <spacer> block is used to create adjustable space between UI elements.

Web View

The <webview> block bypasses Blocks' constraints, offering full control with custom HTML, CSS, and TypeScript within Reddit's platform. While Blocks is native on all platforms, <webview> allows custom extensions without waiting for native implementations.

UI effects.

Adding links

Extending Reddit with Blocks.Extending Reddit with Blocks.

Provide feedback with toasts

Extending Reddit with Blocks.

Solicit user inputs with forms

Extending Reddit with Blocks.