• 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

ListItem

Full-width, tappable list row rendered as an anchor (<a>) by default, or as a Next.js Link via the as prop. Supports an optional trailing icon or element.

When to use

Use ListItem for rows in a navigable or actionable list (settings rows, menu entries, selectable records). Like Button, it is anchor-based, so it works both as a link (with href) and as a button (with onClick / type="submit"), applying the correct role, tabIndex, and keyboard activation automatically.

There is no @uxf/form twin — ListItem is a standalone navigation/action primitive.

Usage

import { ListItem } from "@uxf/ui/list-item";

// row with a trailing chevron
<ListItem endIcon="chevronRight" onClick={onClick}>
    Name Surname
</ListItem>

// plain row
<ListItem onClick={onClick}>No end icon</ListItem>

// row with a custom trailing element
<ListItem endElement={<Icon className="text-success" name="camera" size={24} />} onClick={onClick}>
    End element
</ListItem>

// client-side navigation via Next.js Link
import Link from "next/link";
<ListItem as={Link} href="/detail">Go to detail</ListItem>

Props

Extends AnchorHTMLAttributes<HTMLAnchorElement> (minus type) plus UseAnchorProps, so all standard <a> attributes (href, target, rel, onClick, className, children, …) are accepted. The ref is forwarded to the anchor.

PropTypeDefaultDescription
endIconIconName—Trailing icon (rendered at size 24).
endElementReactNode—Trailing custom element, before endIcon if both are set.
as"a" | NextLink"a"Element to render. Pass Next.js Link for client-side navigation.
isDisabledbooleanfalseNon-interactive state (sets aria-disabled, removes it from tab order).
isLoadingbooleanfalseBusy state (sets aria-busy).
type"submit"—Submits the closest <form> on activation. This is the only accepted type.
analyticsCallback() => void—Called when the row is activated.

Variants & states

  • Button vs. link: with onClick or type="submit" the row gets role="button" and keyboard (Enter/Space) activation; with href it behaves as a hyperlink. When href and target="_blank" are set, rel="noopener noreferrer" is added automatically.
  • Disabled: set isDisabled — clicks and keyboard activation are blocked and the row leaves the tab order.

Requirements

Import the component stylesheet, plus the Icon stylesheet (used by endIcon), once in your global CSS:

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

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

Default
Open in new tab