Skip to content

Translate option.md to Portuguese #1022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions src/content/reference/react-dom/components/option.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ title: "<option>"

<Intro>

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.
O [componente nativo do navegador `<option>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option) permite que você renderize uma opção dentro de uma caixa [`<select>`](/reference/react-dom/components/select).

```js
<select>
<option value="someOption">Some option</option>
<option value="otherOption">Other option</option>
<option value="someOption">Alguma opção</option>
<option value="otherOption">Outra opção</option>
</select>
```

Expand All @@ -19,56 +19,56 @@ The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/

---

## Reference {/*reference*/}
## Referência {/*reference*/}

### `<option>` {/*option*/}

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.
O [componente nativo do navegador `<option>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option) permite que você renderize um option dentro de uma caixa [`<select>`](/reference/react-dom/components/select).

```js
<select>
<option value="someOption">Some option</option>
<option value="otherOption">Other option</option>
<option value="someOption">Alguma opção</option>
<option value="otherOption">Outra opção</option>
</select>
```

[See more examples below.](#usage)
[Veja mais exemplos abaixo.](#usage)

#### Props {/*props*/}

`<option>` supports all [common element props.](/reference/react-dom/components/common#props)
`<option>` suporta todas as [props comuns do elemento.](/reference/react-dom/components/common#props)

Additionally, `<option>` supports these props:
Adicionalmente, `<option>` suporta estas props:

* [`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.
* [`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.
* [`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.
* [`disabled`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#disabled): A boolean. Se `true`, a opção não será selecionável e aparecerá esmaecida.
* [`label`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#label): Uma string. Especifica o significado da opção. Se não especificado, o texto dentro da opção é usado.
* [`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#value): O valor a ser usado [ao enviar o `<select>` pai em um formulário](/reference/react-dom/components/select#reading-the-select-box-value-when-submitting-a-form) se esta opção estiver selecionada.

#### Caveats {/*caveats*/}
#### Ressalvas {/*caveats*/}

* 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.
* React não suporta o atributo `selected` no `<option>`. Em vez disso, passe o `value` desta opção para o componente pai [`<select defaultValue>`](/reference/react-dom/components/select#providing-an-initially-selected-option) para uma caixa de seleção não controlada, ou [`<select value>`](/reference/react-dom/components/select#controlling-a-select-box-with-a-state-variable) para um componente controlado.

---

## Usage {/*usage*/}
## Uso {/*usage*/}

### Displaying a select box with options {/*displaying-a-select-box-with-options*/}
### Exibindo uma caixa de seleção com opções {/*displaying-a-select-box-with-options*/}

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.
Renderize um `<select>` com uma lista de componentes `<option>` dentro para exibir uma caixa de seleção. Dê a cada `<option>` um `value` que representa os dados a serem enviados com o formulário.

[Read more about displaying a `<select>` with a list of `<option>` components.](/reference/react-dom/components/select)
[Leia mais sobre como exibir um `<select>` com uma lista de componentes `<option>`.](/reference/react-dom/components/select)

<Sandpack>

```js
export default function FruitPicker() {
return (
<label>
Pick a fruit:
Escolha uma fruta:
<select name="selectedFruit">
<option value="apple">Apple</option>
<option value="apple">Maçã</option>
<option value="banana">Banana</option>
<option value="orange">Orange</option>
<option value="orange">Laranja</option>
</select>
</label>
);
Expand All @@ -79,5 +79,4 @@ export default function FruitPicker() {
select { margin: 5px; }
```

</Sandpack>

</Sandpack>