AsterUIDocsv1.0.2

Docs / Component reference

SegmentedControl

Keep a small set of mutually exclusive choices visible at once, such as day, week and month.

Segmented control example

Install

sh
npx @fierst/ui@1.0.2 add segmented-control

Registry dependencies: theme.

Exports from ./ui/segmented-control: SegmentedControl.

Download the registry source for segmented-control 1.0.2.

API contracts

ts
export function* SegmentedControl(
  props: {
    options: readonly { value: string; label: string; disabled?: boolean }[];
    value?: string;
    defaultValue?: string;
    fullWidth?: boolean;
    label?: string;
    onChange?: (val: string) => void;
    class?: string;
  },
  ctx: Ctx,
)