Forms
Select
A short list of options.
import { Select } from "@percentsa/ui";Examples
Code
export function SelectExample() {
const t = useT();
return (
<Field label={t("City", "المدينة")} className="w-full max-w-xs">
<Select
placeholder={t("Choose a city", "اختر مدينة")}
options={[
{ value: "ruh", label: t("Riyadh", "الرياض") },
{ value: "jed", label: t("Jeddah", "جدة") },
{ value: "dmm", label: t("Dammam", "الدمام") },
]}
/>
</Field>
);
}
const BANKS = [
["rajhi", "Al Rajhi Bank", "مصرف الراجحي"],
["snb", "Saudi National Bank", "البنك الأهلي السعودي"],
["riyad", "Riyad Bank", "بنك الرياض"],
["alinma", "Alinma Bank", "مصرف الإنماء"],
["albilad", "Bank Albilad", "بنك البلاد"],
["sab", "SAB", "البنك السعودي البريطاني"],
] as const;