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
+27-26Lines changed: 27 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ 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
+
يتيح لك [مكون الـ`<option>`المدمج في المتصفح](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)عرض خيارات داخل عنصر [`<select>`](/reference/react-dom/components/select).
8
8
9
9
```js
10
10
<select>
11
-
<option value="someOption">Some option</option>
12
-
<option value="otherOption">Other option</option>
11
+
<option value="someOption">بعض الخيارات</option>
12
+
<option value="otherOption">خيارات أخرى</option>
13
13
</select>
14
14
```
15
15
@@ -19,56 +19,58 @@ The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/
19
19
20
20
---
21
21
22
-
## Reference {/*reference*/}
22
+
## المرجع {/*reference*/}
23
23
24
24
### `<option>` {/*option*/}
25
25
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.
26
+
يتيح لك [مكون الـ`<option>`المدمج في المتصفح](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select)عرض خيارات داخل عنصر [`<select>`](/reference/react-dom/components/select).
27
27
28
28
```js
29
29
<select>
30
-
<option value="someOption">Some option</option>
31
-
<option value="otherOption">Other option</option>
30
+
<option value="someOption">بعض الخيارات</option>
31
+
<option value="otherOption">خيارات أخرى</option>
32
32
</select>
33
33
```
34
34
35
-
[See more examples below.](#usage)
35
+
[اطّلع على المزيد من الأمثلة في الأسفل.](#usage)
36
36
37
-
#### Props {/*props*/}
37
+
#### الخصائص {/*props*/}
38
38
39
-
`<option>`supports all [common element props.](/reference/react-dom/components/common#props)
39
+
تدعم `<option>`[جميع خصائص العناصر الشائعة.](/reference/react-dom/components/common#props)
40
40
41
-
Additionally, `<option>`supports these props:
41
+
بالإضافة إلى ذلك ، يدعم `<option>`هذه الخصائص:
42
42
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.
43
+
*[`disabled`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#disabled): قيمة منطقية. إذا كانت `true`، فلن يكون الخيار قابلاً للتحديد وسيظهر باهت.
46
44
47
-
#### Caveats {/*caveats*/}
45
+
*[`label`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#label): نص. يحدد معنى الخيار. إذا لم يتم تحديده، فسيتم استخدام النص الموجود داخل الخيار.
48
46
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.
47
+
*[`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) إذا تم اختيار هذا الخيار.
48
+
49
+
#### تنبيه {/*caveats*/}
50
+
51
+
* لا تدعم 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
52
51
53
---
52
54
53
-
## Usage {/*usage*/}
55
+
## الاستخدام {/*usage*/}
54
56
55
-
### Displaying a select box with options {/*displaying-a-select-box-with-options*/}
57
+
### عرض عنصر الاختيار مع الخيارات {/*displaying-a-select-box-with-options*/}
56
58
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.
59
+
قم بإنشاء`<select>`يتضمن داخله قائمة من مكونات `<option>`لعرض مربع تحديد. أعط كل`<option>`قيمة`value`تمثل البيانات التي سيتم رفعها مع النموذج.
58
60
59
-
[Read more about displaying a `<select>`with a list of `<option>` components.](/reference/react-dom/components/select)
61
+
[اقرأ المزيد حول عرض `<select>`بقائمة مكونات `<option>`.](/reference/react-dom/components/select)
60
62
61
63
<Sandpack>
62
64
63
65
```js
64
66
exportdefaultfunctionFruitPicker() {
65
67
return (
66
68
<label>
67
-
Pick a fruit:
69
+
اختر فاكهة:
68
70
<select name="selectedFruit">
69
-
<option value="apple">Apple</option>
70
-
<option value="banana">Banana</option>
71
-
<option value="orange">Orange</option>
71
+
<option value="apple">تفاح</option>
72
+
<option value="banana">موز</option>
73
+
<option value="orange">برتقال</option>
72
74
</select>
73
75
</label>
74
76
);
@@ -79,5 +81,4 @@ export default function FruitPicker() {
0 commit comments