• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
    • WysiwygInput
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • Switch
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • DnDnpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview
View source on GitLab

ButtonList

Horizontal row of Buttons where the first visibleButtonsCount buttons render inline and the rest collapse into an overflow ("more") dropdown menu.

When to use

Use ButtonList for a set of related actions that should degrade gracefully when there are too many to show at once — the overflow ones move into a dropdown triggered by an ellipsis button. Set visibleButtonsCount to how many stay inline (use 0 to put everything in the menu).

  • For a small, fixed set of buttons joined into one segmented control, use ButtonGroup instead.
  • Renders nothing when buttons is empty.

There is no @uxf/form twin — this is a layout component, not a form field.

Usage

import { ButtonList } from "@uxf/ui/button-list";

// all four inline
<ButtonList
    buttons={[
        { label: "First item" },
        { label: "Second item" },
        { label: "Third item" },
        { label: "Fourth item" },
    ]}
    variant="secondary"
    visibleButtonsCount={4}
/>

// one inline, the rest in an overflow dropdown
<ButtonList
    buttons={[
        { icon: "check", label: "First item", onClick: console.log },
        { icon: "user", label: "Second item", color: "positive" },
        { icon: "cloud", label: "Third item" },
        { icon: "xmarkLarge", label: "Fourth item", onClick: console.log },
    ]}
    openButton={{ color: "default", variant: "secondary" }}
    size="sm"
    variant="secondary"
    visibleButtonsCount={1}
/>;

Props

PropTypeDefaultDescription
buttonsSingleButtonProps[]—Required. Buttons to render. See the item shape below.
visibleButtonsCountnumber—Required. How many buttons stay inline; the remainder collapse into the overflow menu.
openButtonSingleButtonProps—Config for the overflow trigger. Defaults to an icon-only button with the ellipsis-vertical icon; set icon: null to hide the icon.
colorButtonProps["color"]—Default color for every button (a per-button color overrides it).
sizeButtonProps["size"]—Default size for every button (a per-button size overrides it).
variantButtonProps["variant"]—Default variant for every button (a per-button variant overrides it).
classNamestring—Extra class on the list wrapper <div>.
classNameDropdownstring—Extra class on the overflow menu container.
menuMaxHeightnumber240Max height of the overflow menu, in px (clamped to the available viewport height).
menuPlacementPlacement"bottom-start"Overflow menu placement (from @floating-ui/react).
menuStrategyStrategy—Overflow menu positioning strategy (from @floating-ui/react).

Each buttons / openButton item is Omit<ButtonProps, "children"> plus:

KeyTypeDescription
labelReactNodeButton text (rendered next to the icon).
iconIconName | nullOptional leading icon.

Variants & states

color, size and variant accept the same values as Button and act as list-wide defaults; any value set on an individual buttons item wins. Per-button states such as isDisabled are supported and also disable the corresponding entry in the overflow menu.

Requirements

Import the component stylesheet once in your global CSS, together with the Button stylesheet:

@import url("@uxf/ui/css/button.css");
@import url("@uxf/ui/css/button-list.css");

Also requires the global @uxf/ui token layer, set up once per app — see @uxf/ui setup.

The overflow menu is an interactive dropdown built on @base-ui/react's Menu and @floating-ui/react and relies on React hooks, so render ButtonList within a client component.

Default
Open in new tab