You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/components/option.md
+39-27Lines changed: 39 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,16 @@ title: "<option>"
4
4
5
5
<Intro>
6
6
7
-
The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option) lets you render an option inside a [`<select>`](/reference/react-dom/components/select) box.
7
+
<divdir="rtl">
8
+
9
+
يتيح لك [مكون الـ `<option>` المدمج في المتصفح](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option) بعرض خيارات داخل مربع [`<select>`](/reference/react-dom/components/select).
10
+
11
+
</div>
8
12
9
13
```js
10
14
<select>
11
-
<option value="someOption">Some option</option>
12
-
<option value="otherOption">Other option</option>
15
+
<option value="someOption">بعض الخيارات</option>
16
+
<option value="otherOption">خيارات أخرى</option>
13
17
</select>
14
18
```
15
19
@@ -19,56 +23,65 @@ The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/
19
23
20
24
---
21
25
22
-
## Reference {/*reference*/}
26
+
<divdir="rtl">
27
+
28
+
## المرجع {/*reference*/}
23
29
24
30
### `<option>` {/*option*/}
25
31
26
-
The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) lets you render an option inside a [`<select>`](/reference/react-dom/components/select) box.
32
+
يتيح لك [مكون الـ `<option>` المدمج في المتصفح](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option) بعرض خيارات داخل مربع [`<select>`](/reference/react-dom/components/select).
33
+
</div>
27
34
28
35
```js
29
36
<select>
30
-
<option value="someOption">Some option</option>
31
-
<option value="otherOption">Other option</option>
37
+
<option value="someOption">بعض الخيارات</option>
38
+
<option value="otherOption">خيارات أخرى</option>
32
39
</select>
33
40
```
34
41
35
-
[See more examples below.](#usage)
42
+
<divdir="rtl">
43
+
44
+
[انظر الى المزيد من الأمثلة في الأسفل.](#usage)
36
45
37
-
#### Props {/*props*/}
46
+
#### الخواص {/*props*/}
38
47
39
-
`<option>`supports all [common element props.](/reference/react-dom/components/common#props)
48
+
تدعم `<option>`[جميع خواص العناصر الشائعة.](/reference/react-dom/components/common#props)
40
49
41
-
Additionally, `<option>`supports these props:
50
+
بالإضافة إلى ذلك ، يدعم `<option>`هذه الخواص:
42
51
43
-
*[`disabled`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#disabled): A boolean. If `true`, the option will not be selectable and will appear dimmed.
44
-
*[`label`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#label): A string. Specifies the meaning of the option. If not specified, the text inside the option is used.
45
-
*[`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#value): The value to be used [when submitting the parent `<select>` in a form](/reference/react-dom/components/select#reading-the-select-box-value-when-submitting-a-form) if this option is selected.
52
+
*[`disabled`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#disabled): قيمة منطقية. إذا كانت `true`، فلن يكون الخيار قابلاً للتحديد وسيظهر باهت.
46
53
47
-
#### Caveats {/*caveats*/}
54
+
*[`label`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#label): سلسلة. تحدد معنى الخيار. إذا لم يتم تحديدها ، فسيتم استخدام النص الموجود داخل الخيار.
48
55
49
-
* React does not support the `selected` attribute on `<option>`. Instead, pass this option's `value` to the parent [`<select defaultValue>`](/reference/react-dom/components/select#providing-an-initially-selected-option) for an uncontrolled select box, or [`<select value>`](/reference/react-dom/components/select#controlling-a-select-box-with-a-state-variable) for a controlled select.
56
+
*[`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#value): القيمة التي سيتم استخدامها [عند إرسال عنصر الأب `<select>` في النموذج](/reference/react-dom/components/select#reading-the-select-box-value-when-submitting-a-form) إذا تم تحديد هذا الخيار.
57
+
58
+
#### تنبيه {/*caveats*/}
59
+
60
+
* لا تدعم React سمة `selected` في `<option>`. بدلاً من ذلك ، قم بتمرير `value` هذا الخيار إلى العنصر الأب [`<select defaultValue>`](/reference/react-dom/components/select#providing-an-initially-selected-option) وذلك لمربع تحديد غير متحكم فيه، أو [`<select value>`](/reference/react-dom/components/select#controlling-a-select-box-with-a-state-variable) لمربع تحديد متحكم فيه.
50
61
51
62
---
52
63
53
-
## Usage {/*usage*/}
64
+
## الاستخدام {/*usage*/}
54
65
55
-
### Displaying a select box with options {/*displaying-a-select-box-with-options*/}
66
+
### عرض مربع التحديد مع الخيارات {/*displaying-a-select-box-with-options*/}
56
67
57
-
Render a`<select>`with a list of `<option>`components inside to display a select box. Give each`<option>`a `value` representing the data to be submitted with the form.
68
+
قم بإنشاء`<select>`يتضمن داخله قائمة من مكونات `<option>`لعرض مربع تحديد. أعط كل`<option>`قيمة `<value>` تمثل البيانات التي سيتم رفعها مع النموذج.
58
69
59
-
[Read more about displaying a `<select>` with a list of `<option>` components.](/reference/react-dom/components/select)
70
+
[اقرأ المزيد حول عرض `<select>` بقائمة مكونات `<option>`.](/reference/react-dom/components/select)
71
+
72
+
</div>
60
73
61
74
<Sandpack>
62
75
63
76
```js
64
77
exportdefaultfunctionFruitPicker() {
65
78
return (
66
-
<label>
67
-
Pick a fruit:
79
+
<label dir="rtl">
80
+
اختر فاكهة:
68
81
<select name="selectedFruit">
69
-
<option value="apple">Apple</option>
70
-
<option value="banana">Banana</option>
71
-
<option value="orange">Orange</option>
82
+
<option value="تفاح">تفاح</option>
83
+
<option value="موز">موز</option>
84
+
<option value="برتقال">برتقال</option>
72
85
</select>
73
86
</label>
74
87
);
@@ -79,5 +92,4 @@ export default function FruitPicker() {
0 commit comments