Index: uspace/app/uidemo/uidemo.c
===================================================================
--- uspace/app/uidemo/uidemo.c	(revision d70dc1c40835f7e957ea1b4fa52c29db4d21ced4)
+++ uspace/app/uidemo/uidemo.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2020 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -68,4 +68,10 @@
 };
 
+static void rb_selected(ui_rbutton_group_t *, void *, void *);
+
+static ui_rbutton_group_cb_t rbutton_group_cb = {
+	.selected = rb_selected
+};
+
 /** Window close button was clicked.
  *
@@ -126,4 +132,22 @@
 }
 
+/** Radio button was selected.
+ *
+ * @param rbgroup Radio button group
+ * @param garg Group argument (demo)
+ * @param barg Button argument
+ */
+static void rb_selected(ui_rbutton_group_t *rbgroup, void *garg, void *barg)
+{
+	ui_demo_t *demo = (ui_demo_t *) garg;
+	const char *text = (const char *) barg;
+	errno_t rc;
+
+	rc = ui_entry_set_text(demo->entry, text);
+	if (rc != EOK)
+		printf("Error changing entry text.\n");
+	(void) ui_entry_paint(demo->entry);
+}
+
 /** Run UI demo on display server. */
 static errno_t ui_demo(const char *display_spec)
@@ -153,5 +177,5 @@
 	params.rect.p0.y = 0;
 	params.rect.p1.x = 220;
-	params.rect.p1.y = 220;
+	params.rect.p1.y = 330;
 
 	memset((void *) &demo, 0, sizeof(demo));
@@ -307,4 +331,70 @@
 
 	rc = ui_fixed_add(demo.fixed, ui_checkbox_ctl(demo.checkbox));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	rc = ui_rbutton_group_create(ui_res, &demo.rbgroup);
+	if (rc != EOK) {
+		printf("Error creating radio button group.\n");
+		return rc;
+	}
+
+	rc = ui_rbutton_create(demo.rbgroup, "Option 1", (void *) "First",
+	    &demo.rb1);
+	if (rc != EOK) {
+		printf("Error creating radio button.\n");
+		return rc;
+	}
+
+	ui_rbutton_group_set_cb(demo.rbgroup, &rbutton_group_cb,
+	    (void *) &demo);
+
+	rect.p0.x = 15;
+	rect.p0.y = 210;
+	rect.p1.x = 140;
+	rect.p1.y = 230;
+	ui_rbutton_set_rect(demo.rb1, &rect);
+
+	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rb1));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	rc = ui_rbutton_create(demo.rbgroup, "Option 2", (void *) "Second",
+	    &demo.rb2);
+	if (rc != EOK) {
+		printf("Error creating radio button.\n");
+		return rc;
+	}
+
+	rect.p0.x = 15;
+	rect.p0.y = 240;
+	rect.p1.x = 140;
+	rect.p1.y = 260;
+	ui_rbutton_set_rect(demo.rb2, &rect);
+
+	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rb2));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	rc = ui_rbutton_create(demo.rbgroup, "Option 3", (void *) "Third",
+	    &demo.rb3);
+	if (rc != EOK) {
+		printf("Error creating radio button.\n");
+		return rc;
+	}
+
+	rect.p0.x = 15;
+	rect.p0.y = 270;
+	rect.p1.x = 140;
+	rect.p1.y = 290;
+	ui_rbutton_set_rect(demo.rb3, &rect);
+
+	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rb3));
 	if (rc != EOK) {
 		printf("Error adding control to layout.\n");
Index: uspace/app/uidemo/uidemo.h
===================================================================
--- uspace/app/uidemo/uidemo.h	(revision d70dc1c40835f7e957ea1b4fa52c29db4d21ced4)
+++ uspace/app/uidemo/uidemo.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2020 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -43,4 +43,5 @@
 #include <ui/label.h>
 #include <ui/pbutton.h>
+#include <ui/rbutton.h>
 #include <ui/ui.h>
 #include <ui/window.h>
@@ -57,4 +58,8 @@
 	ui_pbutton_t *pb2;
 	ui_checkbox_t *checkbox;
+	ui_rbutton_group_t *rbgroup;
+	ui_rbutton_t *rb1;
+	ui_rbutton_t *rb2;
+	ui_rbutton_t *rb3;
 } ui_demo_t;
 
Index: uspace/lib/ui/include/types/ui/paint.h
===================================================================
--- uspace/lib/ui/include/types/ui/paint.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
+++ uspace/lib/ui/include/types/ui/paint.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Painting routines
+ */
+
+#ifndef _UI_TYPES_PAINT_H
+#define _UI_TYPES_PAINT_H
+
+/** Filled circle parts */
+typedef enum {
+	/** Upper-left half */
+	ui_fcircle_upleft = 0x1,
+	/** Lower-right half */
+	ui_fcircle_lowright = 0x2,
+	/** Entire circle */
+	ui_fcircle_entire =
+	    ui_fcircle_upleft |
+	    ui_fcircle_lowright
+} ui_fcircle_part_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/ui/include/types/ui/rbutton.h
===================================================================
--- uspace/lib/ui/include/types/ui/rbutton.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
+++ uspace/lib/ui/include/types/ui/rbutton.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Radio button
+ */
+
+#ifndef _UI_TYPES_RBUTTON_H
+#define _UI_TYPES_RBUTTON_H
+
+#include <stdbool.h>
+
+struct ui_rbutton_group;
+typedef struct ui_rbutton_group ui_rbutton_group_t;
+
+struct ui_rbutton;
+typedef struct ui_rbutton ui_rbutton_t;
+
+/** Radio button callbacks */
+typedef struct ui_rbutton_group_cb {
+	void (*selected)(ui_rbutton_group_t *, void *, void *);
+} ui_rbutton_group_cb_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/ui/include/ui/paint.h
===================================================================
--- uspace/lib/ui/include/ui/paint.h	(revision d70dc1c40835f7e957ea1b4fa52c29db4d21ced4)
+++ uspace/lib/ui/include/ui/paint.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2020 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -40,9 +40,13 @@
 #include <gfx/color.h>
 #include <gfx/coord.h>
+#include <types/ui/paint.h>
 #include <types/ui/resource.h>
 
-errno_t ui_paint_bevel(gfx_context_t *, gfx_rect_t *, gfx_color_t *,
+extern errno_t ui_paint_bevel(gfx_context_t *, gfx_rect_t *, gfx_color_t *,
     gfx_color_t *, gfx_coord_t, gfx_rect_t *);
-errno_t ui_paint_inset_frame(ui_resource_t *, gfx_rect_t *, gfx_rect_t *);
+extern errno_t ui_paint_inset_frame(ui_resource_t *, gfx_rect_t *,
+    gfx_rect_t *);
+extern errno_t ui_paint_filled_circle(gfx_context_t *, gfx_coord2_t *,
+    gfx_coord_t, ui_fcircle_part_t);
 
 #endif
Index: uspace/lib/ui/include/ui/rbutton.h
===================================================================
--- uspace/lib/ui/include/ui/rbutton.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
+++ uspace/lib/ui/include/ui/rbutton.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Radio button
+ */
+
+#ifndef _UI_RBUTTON_H
+#define _UI_RBUTTON_H
+
+#include <errno.h>
+#include <gfx/coord.h>
+#include <io/pos_event.h>
+#include <types/ui/rbutton.h>
+#include <types/ui/control.h>
+#include <types/ui/event.h>
+#include <types/ui/resource.h>
+#include <stdbool.h>
+
+extern errno_t ui_rbutton_group_create(ui_resource_t *,
+    ui_rbutton_group_t **);
+extern void ui_rbutton_group_destroy(ui_rbutton_group_t *);
+extern errno_t ui_rbutton_create(ui_rbutton_group_t *, const char *, void *,
+    ui_rbutton_t **);
+extern void ui_rbutton_destroy(ui_rbutton_t *);
+extern ui_control_t *ui_rbutton_ctl(ui_rbutton_t *);
+extern void ui_rbutton_group_set_cb(ui_rbutton_group_t *, ui_rbutton_group_cb_t *,
+    void *);
+extern void ui_rbutton_set_rect(ui_rbutton_t *, gfx_rect_t *);
+extern errno_t ui_rbutton_paint(ui_rbutton_t *);
+extern void ui_rbutton_press(ui_rbutton_t *);
+extern void ui_rbutton_release(ui_rbutton_t *);
+extern void ui_rbutton_enter(ui_rbutton_t *);
+extern void ui_rbutton_leave(ui_rbutton_t *);
+extern void ui_rbutton_selected(ui_rbutton_t *);
+extern ui_evclaim_t ui_rbutton_pos_event(ui_rbutton_t *, pos_event_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/ui/meson.build
===================================================================
--- uspace/lib/ui/meson.build	(revision d70dc1c40835f7e957ea1b4fa52c29db4d21ced4)
+++ uspace/lib/ui/meson.build	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -1,4 +1,4 @@
 #
-# Copyright (c) 2020 Jiri Svoboda
+# Copyright (c) 2021 Jiri Svoboda
 # All rights reserved.
 #
@@ -38,4 +38,5 @@
 	'src/paint.c',
 	'src/pbutton.c',
+	'src/rbutton.c',
 	'src/resource.c',
 	'src/ui.c',
@@ -54,4 +55,5 @@
 	'test/paint.c',
 	'test/pbutton.c',
+	'test/rbutton.c',
 	'test/resource.c',
 	'test/ui.c',
Index: uspace/lib/ui/private/rbutton.h
===================================================================
--- uspace/lib/ui/private/rbutton.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
+++ uspace/lib/ui/private/rbutton.h	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Radio button structure
+ *
+ */
+
+#ifndef _UI_PRIVATE_RBUTTON_H
+#define _UI_PRIVATE_RBUTTON_H
+
+#include <gfx/coord.h>
+#include <stdbool.h>
+
+/** Actual structure of radio button group.
+ *
+ * This is private to libui.
+ */
+struct ui_rbutton_group {
+	/** UI resource */
+	struct ui_resource *res;
+	/** Callbacks */
+	struct ui_rbutton_group_cb *cb;
+	/** Callback argument */
+	void *arg;
+	/** Selected button */
+	struct ui_rbutton *selected;
+};
+
+/** Actual structure of radio button.
+ *
+ * This is private to libui.
+ */
+struct ui_rbutton {
+	/** Base control object */
+	struct ui_control *control;
+	/** Containing radio button group */
+	struct ui_rbutton_group *group;
+	/** Callback argument */
+	void *arg;
+	/** Radio button rectangle */
+	gfx_rect_t rect;
+	/** Caption */
+	const char *caption;
+	/** Radio button is currently held down */
+	bool held;
+	/** Pointer is currently inside */
+	bool inside;
+};
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/ui/src/paint.c
===================================================================
--- uspace/lib/ui/src/paint.c	(revision d70dc1c40835f7e957ea1b4fa52c29db4d21ced4)
+++ uspace/lib/ui/src/paint.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2020 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -149,4 +149,120 @@
 }
 
+/** Paint filled circle vertical scanline.
+ *
+ * @param gc Graphic context
+ * @param center Coordinates of the center of the circle
+ * @param x X-coordinate of the scanline
+ * @param y0 Lowest Y coordinate of the scanline (inclusive)
+ * @param y1 Highest Y coordinate of the scanline (inclusive)
+ * @param part Which part(s) of cicle to paint
+ * @return EOK on success or an error code
+ */
+static errno_t ui_paint_fcircle_line(gfx_context_t *gc, gfx_coord2_t *center,
+    gfx_coord_t x, gfx_coord_t y0, gfx_coord_t y1, ui_fcircle_part_t part)
+{
+	gfx_rect_t rect;
+	gfx_rect_t trect;
+
+	rect.p0.x = x;
+	rect.p0.y = y0;
+	rect.p1.x = x + 1;
+	rect.p1.y = y1;
+
+	/* Clip to upper-left/lower-right half of circle, if required */
+
+	if ((part & ui_fcircle_upleft) == 0) {
+		if (rect.p0.y < -rect.p1.x)
+			rect.p0.y = -rect.p1.x;
+	}
+
+	if ((part & ui_fcircle_lowright) == 0) {
+		if (rect.p1.y > -rect.p1.x)
+			rect.p1.y = -rect.p1.x;
+	}
+
+	/* If coordinates are reversed, there is nothing to do */
+	if (rect.p1.y <= rect.p0.y)
+		return EOK;
+
+	gfx_rect_translate(center, &rect, &trect);
+
+	return gfx_fill_rect(gc, &trect);
+}
+
+/** Paint filled circle scanlines corresponding to octant point.
+ *
+ * Fills the four vertical scanlines lying between the eight reflections
+ * of a circle point.
+ *
+ * @param gc Graphic context
+ * @param center Coordinates of the center
+ * @param r Radius in pixels
+ * @param part Which part(s) of cicle to paint
+ * @return EOK on success or an error code
+ */
+static int ui_paint_fcircle_point(gfx_context_t *gc, gfx_coord2_t *center,
+    gfx_coord2_t *p, ui_fcircle_part_t part)
+{
+	errno_t rc;
+
+	rc = ui_paint_fcircle_line(gc, center, +p->x, -p->y, p->y + 1, part);
+	if (rc != EOK)
+		return rc;
+	rc = ui_paint_fcircle_line(gc, center, -p->x, -p->y, p->y + 1, part);
+	if (rc != EOK)
+		return rc;
+	rc = ui_paint_fcircle_line(gc, center, +p->y, -p->x, p->x + 1, part);
+	if (rc != EOK)
+		return rc;
+	rc = ui_paint_fcircle_line(gc, center, -p->y, -p->x, p->x + 1, part);
+	if (rc != EOK)
+		return rc;
+
+	return EOK;
+}
+
+/** Paint a filled circle.
+ *
+ * @param gc Graphic context
+ * @param center Coordinates of the center
+ * @param r Radius in pixels
+ * @param part Which part(s) of cicle to paint
+ * @return EOK on success or an error code
+ */
+errno_t ui_paint_filled_circle(gfx_context_t *gc, gfx_coord2_t *center,
+    gfx_coord_t r, ui_fcircle_part_t part)
+{
+	gfx_coord2_t p;
+	gfx_coord_t f;
+	errno_t rc;
+
+	/* Run through one octant using circle midpoint algorithm */
+
+	p.x = r;
+	p.y = 0;
+	f = 1 - r;
+
+	rc = ui_paint_fcircle_point(gc, center, &p, part);
+	if (rc != EOK)
+		return rc;
+
+	while (p.x > p.y) {
+		if (f < 0) {
+			f = f + 2 * p.y + 3;
+		} else {
+			f = f + 2 * (p.y - p.x) + 5;
+			--p.x;
+		}
+		++p.y;
+
+		rc = ui_paint_fcircle_point(gc, center, &p, part);
+		if (rc != EOK)
+			return rc;
+	}
+
+	return EOK;
+}
+
 /** @}
  */
Index: uspace/lib/ui/src/rbutton.c
===================================================================
--- uspace/lib/ui/src/rbutton.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
+++ uspace/lib/ui/src/rbutton.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -0,0 +1,463 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Radio button
+ */
+
+#include <errno.h>
+#include <gfx/color.h>
+#include <gfx/context.h>
+#include <gfx/render.h>
+#include <gfx/text.h>
+#include <io/pos_event.h>
+#include <stdlib.h>
+#include <str.h>
+#include <ui/control.h>
+#include <ui/paint.h>
+#include <ui/rbutton.h>
+#include "../private/rbutton.h"
+#include "../private/resource.h"
+
+enum {
+	rbutton_oframe_r = 7,
+	rbutton_iframe_r = 6,
+	rbutton_interior_r = 5,
+	rbutton_indicator_r = 3,
+	rbutton_label_margin = 8
+};
+
+static void ui_rbutton_ctl_destroy(void *);
+static errno_t ui_rbutton_ctl_paint(void *);
+static ui_evclaim_t ui_rbutton_ctl_pos_event(void *, pos_event_t *);
+
+/** Radio button control ops */
+ui_control_ops_t ui_rbutton_ops = {
+	.destroy = ui_rbutton_ctl_destroy,
+	.paint = ui_rbutton_ctl_paint,
+	.pos_event = ui_rbutton_ctl_pos_event
+};
+
+/** Create new radio button group.
+ *
+ * @param res UI resource
+ * @param rgroup Place to store pointer to new radio button group
+ * @return EOK on success, ENOMEM if out of memory
+ */
+errno_t ui_rbutton_group_create(ui_resource_t *res, ui_rbutton_group_t **rgroup)
+{
+	ui_rbutton_group_t *group;
+
+	group = calloc(1, sizeof(ui_rbutton_group_t));
+	if (group == NULL)
+		return ENOMEM;
+
+	group->res = res;
+	*rgroup = group;
+	return EOK;
+}
+
+/** Destroy radio button group.
+ *
+ * @param group Radio button group or @c NULL
+ */
+void ui_rbutton_group_destroy(ui_rbutton_group_t *group)
+{
+	if (group == NULL)
+		return;
+
+	free(group);
+}
+
+/** Create new radio button.
+ *
+ * @param group Radio button group
+ * @param caption Caption
+ * @param arg Callback argument
+ * @param rrbutton Place to store pointer to new radio button
+ * @return EOK on success, ENOMEM if out of memory
+ */
+errno_t ui_rbutton_create(ui_rbutton_group_t *group, const char *caption,
+    void *arg, ui_rbutton_t **rrbutton)
+{
+	ui_rbutton_t *rbutton;
+	errno_t rc;
+
+	rbutton = calloc(1, sizeof(ui_rbutton_t));
+	if (rbutton == NULL)
+		return ENOMEM;
+
+	rc = ui_control_new(&ui_rbutton_ops, (void *) rbutton,
+	    &rbutton->control);
+	if (rc != EOK) {
+		free(rbutton);
+		return rc;
+	}
+
+	rbutton->caption = str_dup(caption);
+	if (rbutton->caption == NULL) {
+		ui_control_delete(rbutton->control);
+		free(rbutton);
+		return ENOMEM;
+	}
+
+	rbutton->group = group;
+	rbutton->arg = arg;
+
+	if (group->selected == NULL)
+		group->selected = rbutton;
+
+	*rrbutton = rbutton;
+	return EOK;
+}
+
+/** Destroy radio button.
+ *
+ * @param rbutton Radio button or @c NULL
+ */
+void ui_rbutton_destroy(ui_rbutton_t *rbutton)
+{
+	if (rbutton == NULL)
+		return;
+
+	ui_control_delete(rbutton->control);
+	free(rbutton);
+}
+
+/** Get base control from radio button.
+ *
+ * @param rbutton Radio button
+ * @return Control
+ */
+ui_control_t *ui_rbutton_ctl(ui_rbutton_t *rbutton)
+{
+	return rbutton->control;
+}
+
+/** Set radio button group callbacks.
+ *
+ * @param group Radio button group
+ * @param cb Radio button group callbacks
+ * @param arg Callback argument
+ */
+void ui_rbutton_group_set_cb(ui_rbutton_group_t *group,
+    ui_rbutton_group_cb_t *cb, void *arg)
+{
+	group->cb = cb;
+	group->arg = arg;
+}
+
+/** Set button rectangle.
+ *
+ * @param rbutton Button
+ * @param rect New button rectangle
+ */
+void ui_rbutton_set_rect(ui_rbutton_t *rbutton, gfx_rect_t *rect)
+{
+	rbutton->rect = *rect;
+}
+
+/** Paint radio button.
+ *
+ * @param rbutton Radio button
+ * @return EOK on success or an error code
+ */
+errno_t ui_rbutton_paint(ui_rbutton_t *rbutton)
+{
+	gfx_coord2_t pos;
+	gfx_coord2_t center;
+	gfx_text_fmt_t fmt;
+	bool depressed;
+	errno_t rc;
+
+	center.x = rbutton->rect.p0.x + rbutton_oframe_r;
+	center.y = rbutton->rect.p0.y + rbutton_oframe_r;
+
+	/* Paint rbutton frame */
+
+	rc = gfx_set_color(rbutton->group->res->gc,
+	    rbutton->group->res->wnd_shadow_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = ui_paint_filled_circle(rbutton->group->res->gc,
+	    &center, rbutton_oframe_r, ui_fcircle_upleft);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_set_color(rbutton->group->res->gc,
+	    rbutton->group->res->wnd_highlight_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = ui_paint_filled_circle(rbutton->group->res->gc,
+	    &center, rbutton_oframe_r, ui_fcircle_lowright);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_set_color(rbutton->group->res->gc,
+	    rbutton->group->res->wnd_frame_sh_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = ui_paint_filled_circle(rbutton->group->res->gc,
+	    &center, rbutton_iframe_r, ui_fcircle_upleft);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_set_color(rbutton->group->res->gc,
+	    rbutton->group->res->wnd_face_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = ui_paint_filled_circle(rbutton->group->res->gc,
+	    &center, rbutton_iframe_r, ui_fcircle_lowright);
+	if (rc != EOK)
+		goto error;
+
+	/* Paint rbutton interior */
+	depressed = rbutton->held && rbutton->inside;
+
+	rc = gfx_set_color(rbutton->group->res->gc, depressed ?
+	    rbutton->group->res->entry_act_bg_color :
+	    rbutton->group->res->entry_bg_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = ui_paint_filled_circle(rbutton->group->res->gc,
+	    &center, rbutton_interior_r, ui_fcircle_entire);
+	if (rc != EOK)
+		goto error;
+
+	/* Paint active mark */
+
+	if (rbutton->group->selected == rbutton) {
+		rc = gfx_set_color(rbutton->group->res->gc,
+		    rbutton->group->res->entry_fg_color);
+		if (rc != EOK)
+			goto error;
+
+		rc = ui_paint_filled_circle(rbutton->group->res->gc,
+		    &center, rbutton_indicator_r, ui_fcircle_entire);
+		if (rc != EOK)
+			goto error;
+	}
+
+	/* Paint rbutton label */
+
+	rc = gfx_set_color(rbutton->group->res->gc,
+	    rbutton->group->res->wnd_text_color);
+	if (rc != EOK)
+		goto error;
+
+	/* Label position */
+	pos.x = center.x + rbutton_oframe_r + rbutton_label_margin;
+	pos.y = (rbutton->rect.p0.y + rbutton->rect.p1.y) / 2;
+
+	gfx_text_fmt_init(&fmt);
+	fmt.halign = gfx_halign_left;
+	fmt.valign = gfx_valign_center;
+
+	rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt,
+	    rbutton->caption);
+	if (rc != EOK)
+		goto error;
+
+	return EOK;
+error:
+	return rc;
+}
+
+/** Press down button.
+ *
+ * @param rbutton Radio button
+ */
+void ui_rbutton_press(ui_rbutton_t *rbutton)
+{
+	if (rbutton->held)
+		return;
+
+	rbutton->inside = true;
+	rbutton->held = true;
+	(void) ui_rbutton_paint(rbutton);
+}
+
+/** Release button.
+ *
+ * @param rbutton Radio button
+ */
+void ui_rbutton_release(ui_rbutton_t *rbutton)
+{
+	ui_rbutton_t *old_selected;
+
+	if (!rbutton->held)
+		return;
+
+	rbutton->held = false;
+
+	if (rbutton->inside) {
+		/* Activate radio button */
+		old_selected = rbutton->group->selected;
+
+		if (old_selected != rbutton) {
+			rbutton->group->selected = rbutton;
+			ui_rbutton_paint(old_selected);
+		}
+
+		/* Repaint and notify */
+		(void) ui_rbutton_paint(rbutton);
+
+		if (old_selected != rbutton)
+			ui_rbutton_selected(rbutton);
+	}
+}
+
+/** Pointer entered button.
+ *
+ * @param rbutton Radio button
+ */
+void ui_rbutton_enter(ui_rbutton_t *rbutton)
+{
+	if (rbutton->inside)
+		return;
+
+	rbutton->inside = true;
+	if (rbutton->held)
+		(void) ui_rbutton_paint(rbutton);
+}
+
+/** Pointer left button.
+ *
+ * @param rbutton Radio button
+ */
+void ui_rbutton_leave(ui_rbutton_t *rbutton)
+{
+	if (!rbutton->inside)
+		return;
+
+	rbutton->inside = false;
+	if (rbutton->held)
+		(void) ui_rbutton_paint(rbutton);
+}
+
+/** Button was selected.
+ *
+ * @param rbutton Radio button
+ */
+void ui_rbutton_selected(ui_rbutton_t *rbutton)
+{
+	ui_rbutton_group_t *group = rbutton->group;
+
+	if (group->cb != NULL && group->cb->selected != NULL) {
+		group->cb->selected(group, group->arg, rbutton->arg);
+	}
+}
+
+/** Handle radio button position event.
+ *
+ * @param rbutton Radio button
+ * @param pos_event Position event
+ * @return @c ui_claimed iff the event is claimed
+ */
+ui_evclaim_t ui_rbutton_pos_event(ui_rbutton_t *rbutton, pos_event_t *event)
+{
+	gfx_coord2_t pos;
+	bool inside;
+
+	pos.x = event->hpos;
+	pos.y = event->vpos;
+
+	inside = gfx_pix_inside_rect(&pos, &rbutton->rect);
+
+	switch (event->type) {
+	case POS_PRESS:
+		if (inside) {
+			ui_rbutton_press(rbutton);
+			return ui_claimed;
+		}
+		break;
+	case POS_RELEASE:
+		if (rbutton->held) {
+			ui_rbutton_release(rbutton);
+			return ui_claimed;
+		}
+		break;
+	case POS_UPDATE:
+		if (inside && !rbutton->inside) {
+			ui_rbutton_enter(rbutton);
+			return ui_claimed;
+		} else if (!inside && rbutton->inside) {
+			ui_rbutton_leave(rbutton);
+		}
+		break;
+	}
+
+	return ui_unclaimed;
+}
+
+/** Destroy radio button control.
+ *
+ * @param arg Argument (ui_rbutton_t *)
+ */
+void ui_rbutton_ctl_destroy(void *arg)
+{
+	ui_rbutton_t *rbutton = (ui_rbutton_t *) arg;
+
+	ui_rbutton_destroy(rbutton);
+}
+
+/** Paint radio button control.
+ *
+ * @param arg Argument (ui_rbutton_t *)
+ * @return EOK on success or an error code
+ */
+errno_t ui_rbutton_ctl_paint(void *arg)
+{
+	ui_rbutton_t *rbutton = (ui_rbutton_t *) arg;
+
+	return ui_rbutton_paint(rbutton);
+}
+
+/** Handle radio button control position event.
+ *
+ * @param arg Argument (ui_rbutton_t *)
+ * @param pos_event Position event
+ * @return @c ui_claimed iff the event is claimed
+ */
+ui_evclaim_t ui_rbutton_ctl_pos_event(void *arg, pos_event_t *event)
+{
+	ui_rbutton_t *rbutton = (ui_rbutton_t *) arg;
+
+	return ui_rbutton_pos_event(rbutton, event);
+}
+
+/** @}
+ */
Index: uspace/lib/ui/src/resource.c
===================================================================
--- uspace/lib/ui/src/resource.c	(revision d70dc1c40835f7e957ea1b4fa52c29db4d21ced4)
+++ uspace/lib/ui/src/resource.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2020 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -130,5 +130,5 @@
 		goto error;
 
-	rc = gfx_color_new_rgb_i16(0, 0, 0, &wnd_frame_sh_color);
+	rc = gfx_color_new_rgb_i16(0x4444, 0x4444, 0x4444, &wnd_frame_sh_color);
 	if (rc != EOK)
 		goto error;
Index: uspace/lib/ui/test/main.c
===================================================================
--- uspace/lib/ui/test/main.c	(revision d70dc1c40835f7e957ea1b4fa52c29db4d21ced4)
+++ uspace/lib/ui/test/main.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2020 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -39,4 +39,5 @@
 PCUT_IMPORT(paint);
 PCUT_IMPORT(pbutton);
+PCUT_IMPORT(rbutton);
 PCUT_IMPORT(resource);
 PCUT_IMPORT(ui);
Index: uspace/lib/ui/test/rbutton.c
===================================================================
--- uspace/lib/ui/test/rbutton.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
+++ uspace/lib/ui/test/rbutton.c	(revision 7020d1ffb2252c7a016ab32d1c98df8473acee73)
@@ -0,0 +1,618 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gfx/context.h>
+#include <gfx/coord.h>
+#include <mem.h>
+#include <pcut/pcut.h>
+#include <stdbool.h>
+#include <ui/control.h>
+#include <ui/rbutton.h>
+#include <ui/resource.h>
+#include "../private/rbutton.h"
+
+PCUT_INIT;
+
+PCUT_TEST_SUITE(rbutton);
+
+static errno_t testgc_set_color(void *, gfx_color_t *);
+static errno_t testgc_fill_rect(void *, gfx_rect_t *);
+static errno_t testgc_bitmap_create(void *, gfx_bitmap_params_t *,
+    gfx_bitmap_alloc_t *, void **);
+static errno_t testgc_bitmap_destroy(void *);
+static errno_t testgc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
+static errno_t testgc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
+
+static gfx_context_ops_t ops = {
+	.set_color = testgc_set_color,
+	.fill_rect = testgc_fill_rect,
+	.bitmap_create = testgc_bitmap_create,
+	.bitmap_destroy = testgc_bitmap_destroy,
+	.bitmap_render = testgc_bitmap_render,
+	.bitmap_get_alloc = testgc_bitmap_get_alloc
+};
+
+static void test_rbutton_select(ui_rbutton_group_t *, void *, void *);
+
+static ui_rbutton_group_cb_t test_rbutton_group_cb = {
+	.selected = test_rbutton_select
+};
+
+static ui_rbutton_group_cb_t dummy_rbutton_group_cb = {
+};
+
+typedef struct {
+	bool bm_created;
+	bool bm_destroyed;
+	gfx_bitmap_params_t bm_params;
+	void *bm_pixels;
+	gfx_rect_t bm_srect;
+	gfx_coord2_t bm_offs;
+	bool bm_rendered;
+	bool bm_got_alloc;
+} test_gc_t;
+
+typedef struct {
+	test_gc_t *tgc;
+	gfx_bitmap_alloc_t alloc;
+	bool myalloc;
+} testgc_bitmap_t;
+
+typedef struct {
+	bool selected;
+} test_cb_resp_t;
+
+/** Create and destroy radio button */
+PCUT_TEST(create_destroy)
+{
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton = NULL;
+	errno_t rc;
+
+	rc = ui_rbutton_group_create(NULL, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(rbutton);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+}
+
+/** ui_rbutton_destroy() can take NULL argument (no-op) */
+PCUT_TEST(destroy_null)
+{
+	ui_rbutton_destroy(NULL);
+}
+
+/** ui_rbutton_ctl() returns control that has a working virtual destructor */
+PCUT_TEST(ctl)
+{
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	ui_control_t *control;
+	errno_t rc;
+
+	rc = ui_rbutton_group_create(NULL, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	control = ui_rbutton_ctl(rbutton);
+	PCUT_ASSERT_NOT_NULL(control);
+
+	ui_control_destroy(control);
+	ui_rbutton_group_destroy(group);
+}
+
+/** Set radio button rectangle sets internal field */
+PCUT_TEST(set_rect)
+{
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	gfx_rect_t rect;
+	errno_t rc;
+
+	rc = ui_rbutton_group_create(NULL, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 1;
+	rect.p0.y = 2;
+	rect.p1.x = 3;
+	rect.p1.y = 4;
+
+	ui_rbutton_set_rect(rbutton, &rect);
+	PCUT_ASSERT_INT_EQUALS(rect.p0.x, rbutton->rect.p0.x);
+	PCUT_ASSERT_INT_EQUALS(rect.p0.y, rbutton->rect.p0.y);
+	PCUT_ASSERT_INT_EQUALS(rect.p1.x, rbutton->rect.p1.x);
+	PCUT_ASSERT_INT_EQUALS(rect.p1.y, rbutton->rect.p1.y);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+}
+
+/** Paint radio button */
+PCUT_TEST(paint)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	ui_rbutton_group_t *group = NULL;
+	ui_resource_t *resource = NULL;
+	ui_rbutton_t *rbutton;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_resource_create(gc, &resource);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(resource);
+
+	rc = ui_rbutton_group_create(resource, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_paint(rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+	ui_resource_destroy(resource);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Test ui_rbutton_selected() */
+PCUT_TEST(selected)
+{
+	errno_t rc;
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	test_cb_resp_t resp;
+
+	rc = ui_rbutton_group_create(NULL, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Selected with no callbacks set */
+	ui_rbutton_selected(rbutton);
+
+	/* Selected with callback not implementing selected */
+	ui_rbutton_group_set_cb(group, &dummy_rbutton_group_cb, NULL);
+	ui_rbutton_selected(rbutton);
+
+	/* Selected with real callback set */
+	resp.selected = false;
+	ui_rbutton_group_set_cb(group, &test_rbutton_group_cb, &resp);
+	ui_rbutton_selected(rbutton);
+	PCUT_ASSERT_TRUE(resp.selected);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+}
+
+/** Press and release radio button */
+PCUT_TEST(press_release)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	ui_resource_t *resource = NULL;
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	test_cb_resp_t resp;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_resource_create(gc, &resource);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(resource);
+
+	rc = ui_rbutton_group_create(resource, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NULL(group->selected);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	resp.selected = false;
+	ui_rbutton_group_set_cb(group, &test_rbutton_group_cb, &resp);
+
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+
+	ui_rbutton_press(rbutton);
+	PCUT_ASSERT_TRUE(rbutton->held);
+	PCUT_ASSERT_TRUE(rbutton->inside);
+	PCUT_ASSERT_FALSE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_release(rbutton);
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_TRUE(rbutton->inside);
+	PCUT_ASSERT_TRUE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+	ui_resource_destroy(resource);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Press, leave and release radio button */
+PCUT_TEST(press_leave_release)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	ui_resource_t *resource = NULL;
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	test_cb_resp_t resp;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_resource_create(gc, &resource);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(resource);
+
+	rc = ui_rbutton_group_create(resource, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	resp.selected = false;
+	ui_rbutton_group_set_cb(group, &test_rbutton_group_cb, &resp);
+
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+
+	ui_rbutton_press(rbutton);
+	PCUT_ASSERT_TRUE(rbutton->held);
+	PCUT_ASSERT_TRUE(rbutton->inside);
+	PCUT_ASSERT_FALSE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_leave(rbutton);
+	PCUT_ASSERT_TRUE(rbutton->held);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+	PCUT_ASSERT_FALSE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_release(rbutton);
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+	PCUT_ASSERT_FALSE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+	ui_resource_destroy(resource);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Press, leave, enter and release radio button */
+PCUT_TEST(press_leave_enter_release)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	ui_resource_t *resource = NULL;
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	test_cb_resp_t resp;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_resource_create(gc, &resource);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(resource);
+
+	rc = ui_rbutton_group_create(resource, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	resp.selected = false;
+	ui_rbutton_group_set_cb(group, &test_rbutton_group_cb, &resp);
+
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+
+	ui_rbutton_press(rbutton);
+	PCUT_ASSERT_TRUE(rbutton->held);
+	PCUT_ASSERT_TRUE(rbutton->inside);
+	PCUT_ASSERT_FALSE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_leave(rbutton);
+	PCUT_ASSERT_TRUE(rbutton->held);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+	PCUT_ASSERT_FALSE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_enter(rbutton);
+	PCUT_ASSERT_TRUE(rbutton->held);
+	PCUT_ASSERT_TRUE(rbutton->inside);
+	PCUT_ASSERT_FALSE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_release(rbutton);
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_TRUE(rbutton->inside);
+	PCUT_ASSERT_TRUE(resp.selected);
+	PCUT_ASSERT_EQUALS(group->selected, rbutton);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+	ui_resource_destroy(resource);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** ui_pos_event() correctly translates POS_PRESS/POS_RELEASE */
+PCUT_TEST(pos_event_press_release)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	ui_resource_t *resource = NULL;
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	ui_evclaim_t claim;
+	pos_event_t event;
+	gfx_rect_t rect;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_resource_create(gc, &resource);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(resource);
+
+	rc = ui_rbutton_group_create(resource, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_FALSE(rbutton->held);
+
+	rect.p0.x = 10;
+	rect.p0.y = 20;
+	rect.p1.x = 30;
+	rect.p1.y = 40;
+	ui_rbutton_set_rect(rbutton, &rect);
+
+	/* Press outside is not claimed and does nothing */
+	event.type = POS_PRESS;
+	event.hpos = 9;
+	event.vpos = 20;
+	claim = ui_rbutton_pos_event(rbutton, &event);
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_EQUALS(ui_unclaimed, claim);
+
+	/* Press inside is claimed and depresses radio button */
+	event.type = POS_PRESS;
+	event.hpos = 10;
+	event.vpos = 20;
+	claim = ui_rbutton_pos_event(rbutton, &event);
+	PCUT_ASSERT_TRUE(rbutton->held);
+	PCUT_ASSERT_EQUALS(ui_claimed, claim);
+
+	/* Release outside (or anywhere) is claimed and relases radio button */
+	event.type = POS_RELEASE;
+	event.hpos = 9;
+	event.vpos = 20;
+	claim = ui_rbutton_pos_event(rbutton, &event);
+	PCUT_ASSERT_FALSE(rbutton->held);
+	PCUT_ASSERT_EQUALS(ui_claimed, claim);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+	ui_resource_destroy(resource);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** ui_pos_event() correctly translates POS_UPDATE to enter/leave */
+PCUT_TEST(pos_event_enter_leave)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	ui_resource_t *resource = NULL;
+	ui_rbutton_group_t *group = NULL;
+	ui_rbutton_t *rbutton;
+	pos_event_t event;
+	gfx_rect_t rect;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_resource_create(gc, &resource);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(resource);
+
+	rc = ui_rbutton_group_create(resource, &group);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_FALSE(rbutton->inside);
+
+	rect.p0.x = 10;
+	rect.p0.y = 20;
+	rect.p1.x = 30;
+	rect.p1.y = 40;
+	ui_rbutton_set_rect(rbutton, &rect);
+
+	/* Moving outside does nothing */
+	event.type = POS_UPDATE;
+	event.hpos = 9;
+	event.vpos = 20;
+	ui_rbutton_pos_event(rbutton, &event);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+
+	/* Moving inside sets inside flag */
+	event.type = POS_UPDATE;
+	event.hpos = 10;
+	event.vpos = 20;
+	ui_rbutton_pos_event(rbutton, &event);
+	PCUT_ASSERT_TRUE(rbutton->inside);
+
+	/* Moving outside clears inside flag */
+	event.type = POS_UPDATE;
+	event.hpos = 9;
+	event.vpos = 20;
+	ui_rbutton_pos_event(rbutton, &event);
+	PCUT_ASSERT_FALSE(rbutton->inside);
+
+	ui_rbutton_destroy(rbutton);
+	ui_rbutton_group_destroy(group);
+	ui_resource_destroy(resource);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+static errno_t testgc_set_color(void *arg, gfx_color_t *color)
+{
+	(void) arg;
+	(void) color;
+	return EOK;
+}
+
+static errno_t testgc_fill_rect(void *arg, gfx_rect_t *rect)
+{
+	(void) arg;
+	(void) rect;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_create(void *arg, gfx_bitmap_params_t *params,
+    gfx_bitmap_alloc_t *alloc, void **rbm)
+{
+	test_gc_t *tgc = (test_gc_t *) arg;
+	testgc_bitmap_t *tbm;
+
+	tbm = calloc(1, sizeof(testgc_bitmap_t));
+	if (tbm == NULL)
+		return ENOMEM;
+
+	if (alloc == NULL) {
+		tbm->alloc.pitch = (params->rect.p1.x - params->rect.p0.x) *
+		    sizeof(uint32_t);
+		tbm->alloc.off0 = 0;
+		tbm->alloc.pixels = calloc(sizeof(uint32_t),
+		    (params->rect.p1.x - params->rect.p0.x) *
+		    (params->rect.p1.y - params->rect.p0.y));
+		tbm->myalloc = true;
+		if (tbm->alloc.pixels == NULL) {
+			free(tbm);
+			return ENOMEM;
+		}
+	} else {
+		tbm->alloc = *alloc;
+	}
+
+	tbm->tgc = tgc;
+	tgc->bm_created = true;
+	tgc->bm_params = *params;
+	tgc->bm_pixels = tbm->alloc.pixels;
+	*rbm = (void *)tbm;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_destroy(void *bm)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	if (tbm->myalloc)
+		free(tbm->alloc.pixels);
+	tbm->tgc->bm_destroyed = true;
+	free(tbm);
+	return EOK;
+}
+
+static errno_t testgc_bitmap_render(void *bm, gfx_rect_t *srect,
+    gfx_coord2_t *offs)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	tbm->tgc->bm_rendered = true;
+	tbm->tgc->bm_srect = *srect;
+	tbm->tgc->bm_offs = *offs;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_get_alloc(void *bm, gfx_bitmap_alloc_t *alloc)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	*alloc = tbm->alloc;
+	tbm->tgc->bm_got_alloc = true;
+	return EOK;
+}
+
+static void test_rbutton_select(ui_rbutton_group_t *group, void *arg,
+    void *barg)
+{
+	test_cb_resp_t *resp = (test_cb_resp_t *) arg;
+
+	resp->selected = true;
+}
+
+PCUT_EXPORT(rbutton);
