Skip to main content
CustomButton Examples

What is CustomButton?

CustomButton is a beautiful and minimalistic Android UI library that provides customizable buttons with outline and drawable support. Built as an extension of AppCompatTextView, CustomButton offers a modern alternative to Android’s Material buttons with better drawable support and consistent appearance across Android versions.

Key features

Customizable outlines

Define custom stroke widths and colors with independent normal and selected states

Drawable support

Add left and right drawables with precise control over size and positioning

State management

Built-in touch listeners with automatic state transitions and custom color schemes

Minimal design

Flat, elegant buttons that look consistent across all Android versions (API 15+)

Why CustomButton?

CustomButton was created as a replacement for Android’s Material buttons, offering several advantages:
  • Flat design - Clean, minimalistic appearance without unnecessary elevation
  • Better drawable control - Programmatically add and size drawables with ease
  • Cross-version consistency - Looks the same on all Android versions
  • Lightweight - Extends AppCompatTextView, so all TextView functionality is available
  • Customizable states - Independent colors for normal and selected states across text, background, and stroke
CustomButton is part of the Custom UI collection of beautiful, minimalistic, and customizable Android UI components.

Get started

Installation

Add CustomButton to your project using Gradle and JitPack

Quickstart

Create your first custom button in under 5 minutes

Customization guides

Learn how to customize buttons with XML and programmatically

Build docs developers (and LLMs) love