Skip to content

Cascader

Beta
Get Ritla UI

A field that opens columns of nested choices, such as governorate, district and area, and fills in the whole path.

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add cascader

    Also works with shadcn: npx shadcn@latest add @ritla/cascader

  2. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

cascader.tsx
import { Cascader } from "@/components/ui/cascader";<Cascader label="Delivery area" options={areas} onValueChange={setPath} />

API reference

Cascader

PropTypeDefaultDescription
options{ value, label, children?, disabled? }[]NoneThe tree; the last level has no children.
value / defaultValue / onValueChangestring[]NoneThe chosen path, a value per level.
levelLabelsstring[]NoneNames each column for screen readers.
placeholder / separatorstring" / "The text before a choice, and the separator between levels.
label / required / helperText / error / disabled / name…NoneAs on the Select.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
EnterSpaceOpens the panel, opens the next column, and chooses on the last level.
ArrowDownArrowUpMoves within a column.
ArrowRightArrowLeftTo the next or previous column. In Arabic, ArrowLeft goes to the next.
EscapeCloses the panel and returns focus to the field.

ARIA

  • Each column is a listbox named by its level, and an open item carries aria-expanded.
  • The field reads its label and the chosen path.

Arabic and RTL notes

Mirrors

  • The first column sits on the right and the carets point left.
  • The path in the field reads from the right: عمّان / وادي السير / خلدا.

Does not mirror

  • The field's caret points down in both directions.
Numerals
It usually holds no numbers.
Arabic typography
label-16 in the field, label-14 Medium in the columns.