Phoenix UI

Phoenix UI home page
  1. Getting Started
  2. Installation: Tailwind CLI

Button Group

The ButtonGroup component can be used to group related buttons.

Examples

Below you can view various demos with example markup.

Variant

All the standard button variants are supported.

Orientation

The button group can be displayed vertically using the orientation attribute.

Size

The size attribute can be used to control the appearance of the button group.

Color

The color attribute can be used to control the appearance of the button group.

API

API documentation for the component. Learn about imports and available attributes.

Import

There are multiple ways to import components.


    # PhoenixUI macro which imports all components
    use PhoenixUI
    # Or import component individually
    import PhoenixUI.Components.ButtonGroup, only: [button_group: 1]
    

Attributes

Below is a list of attributes that can be applied to the component.

Name Type Default Description
HTML attribute any Supports all HTML attributes.
color any tailwind color blue Any Tailwind-supported color.
element any HTML element div HTML element to use.
extend_class string Adds additional classes.
phx-{any} binding Supports all Phoenix DOM element bindings.
size "xs" | "sm" | "md" | "lg" | "xl" md
square bool false if true, has square edges
variant "contained" | "outlined" | "text" contained