
Modrinth · Minecraft mod
Brapi
A Fast UI Rendering Library for Fabric mods. Border radius, gradients, textures and text.
Quick answer
Which Brapi release should I use?
Brapi 0.26+1.21.11+fabric targets 1.21.11 with Fabric. It must be installed on the client. Do not install it on the dedicated server. All 1 required mods have matching files.
Where it goes
Is Brapi required on the client, server, or both?
It must be installed on the client. Do not install it on the dedicated server.
This file is marked client-only.
What else does Brapi 0.26+1.21.11+fabric need?
0.26+1.21.11+fabric. Change the file and its required mods may change too.
Install Fabric API first. We found matching files for this game-version and loader setup.
We only count dependency files that match this setup. A file for another loader does not fill the gap.
Before you install it
Add Brapi without breaking your instance.
Built for Brapi 0.26+1.21.11+fabric. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 0.26+1.21.11+fabric. It targets 1.21.11 with Fabric; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
Install Fabric API first. We found matching files for this game-version and loader setup.
- 03
Put it on the correct side
It must be installed on the client. Do not install it on the dedicated server.
- 04
Pick the file you checked
Use the “Get this file” button beside 0.26+1.21.11+fabric. It opens that exact file at the source.
About this project
What does Brapi add?
Brapi
A UI rendering library for Fabric mods. Supports rounded rectangles, text, gradients, textures, and 9-slice sprites with a simple API. With future support for SVG rasterizer, shadows, more text options, toggleable immediate mode rendering and lines.
Why
Making good-looking UIs in Minecraft is harder than it should be. Vanilla's tools work fine for basic boxes, but as soon as you want smooth rounded corners, circles, or nice-looking text, you hit a wall.
Normally you're stuck with two options:
- Bring in a heavy graphics library like Skia, which is hard to set-up for first time and makes the mod size very big
- Write your own shaders from scratch, which means dealing with extra setup and boilerplate most modders would rather skip
Brapi gives a third option. It's a lightweight layer that sits on top of Minecraft's existing rendering system, so you get the nice visuals without the pain.
Key Benefits:
- Zero Boilerplate: No setup hassle. Just create a BRender, add your draw calls, and flush.
- Complex Shapes Made Simple: Draw circles, outlines, and rounded rectangles (even with different corner sizes) in a single line of code.
- Automatic Batching & Layering: Brapi figures out the right draw order on its own, so your UI looks right without you micromanaging it.
📦 Setup
Adding as dependency
Add the repository and dependency to build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
dependencies {
modImplementation "maven.modrinth:brapi:0.26+${minecraft_version}+fabric" // only supported minecraft version is 1.21.11 right now
}
fabric.mod.json:
"depends": {
"brapi": "*"
}
Using in code
Create a BRender instance, add draw calls, then call flush(graphics) to submit. Everything renders at end of frame sorted by layer.
🎨 All colors are ARGB: 0xFFFF0000 = opaque red, 0x80FF0000 = 50% transparent red.
📐 Coordinates are in GuiScale units: (100, 100) at scale 3 = (300, 300) pixels.
Filled shapes
bRender.rect(100, 100, 100, 100, 0xFFFF0000, layer);- red 100x100 rectanglebRender.roundRect(100, 100, 100, 100, 0xFFFF0000, 10, layer);- rounded rectangle, 10px radiusbRender.roundRect(100, 100, 100, 100, 0xFFFF0000, 10, 5, layer);- 10px TL/BR, 5px TR/BL radiusbRender.roundRect(100, 100, 100, 100, 0xFFFF0000, 10, 5, 20, 30, layer);- individual corner radiibRender.circle(100, 100, 50, 0xFFFF0000, layer);- circle, 50px radius
Gradients
All filled shapes support gradients via Gradient and GradientDirection:
bRender.roundRect(100, 100, 100, 100, gradient, GradientDirection.LEFT_RIGHT, 10, layer);
Directions: LEFT_RIGHT, TOP_BOTTOM, TOP_LEFT_BOTTOM_RIGHT, TOP_RIGHT_BOTTOM_LEFT
Strokes (outline only)
bRender.stroke(100, 100, 100, 100, 0xFFFF0000, 2, layer);- 2px outline rectanglebRender.strokeRounded(100, 100, 100, 100, 0xFFFF0000, 10, 2, layer);- 2px rounded outline, 10px radiusbRender.strokeRounded(100, 100, 100, 100, 0xFFFF0000, 10, 5, 2, layer);- 10px TL/BR, 5px TR/BLbRender.strokeRounded(100, 100, 100, 100, 0xFFFF0000, 10, 5, 20, 30, 2, layer);- individual radii
Filled + stroke
bRender.roundRectStroked(100, 100, 100, 100, 0xFF0000FF, 0xFFFF0000, 10, 2, layer);- blue fill, 2px red stroke
Text
bRender.drawText(font, "Hello!", 100, 100, 24, 0xFFFFFFFF, layer);- BFont textbRender.drawText(font, formattedCharSequence, 100, 100, 24, 0xFFFFFFFF, layer);- formatted text with per-character colors
Textures
bRender.drawTexture(tex, 100, 100, 200, 150, 0xFFFFFFFF, linear, layer);- stretch to fillbRender.drawTextureCropped(tex, 100, 100, 64, 64, 0, 0, 32, 32, 0xFFFFFFFF, linear, layer);- cropbRender.drawTextureTiled(tex, 100, 100, 200, 200, 0xFFFFFFFF, linear, layer);- tilebRender.drawTexture9Slice(slice, 100, 100, 300, 200, 0xFFFFFFFF, linear, layer);- 9-slice
🔄 Flushing
BRender r = new BRender();
r.roundRect(...);
r.flush(graphics); // submit to draw list
//OR
r.flush(graphics, BRender.WithOffset(100, 100)); // with 100 pixel offset
Project description from Modrinth.
Pick your setup
Brapi by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
1.21.11
1 loader buildCheck the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
Brapi versions and loaders
0.26+1.21.11+fabric
brapi-0.26.jar
11 Aug 2026
0.25.3+1.21.11+fabric
brapi-0.25.3.jar
1 Jul 2026
0.25.1+1.21.11+fabric
brapi-0.25.1.jar
21 Jun 2026
0.25+1.21.11+fabric
brapi-0.25.jar
18 Jun 2026
Looking for an older file? The official Modrinth project page is in Resources.