Skip to content
Open
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
35 changes: 20 additions & 15 deletions docs/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ id: switch
title: Switch
---

Renders a boolean input.
真偽値のインプットを描画します。

This is a controlled component that requires an `onValueChange` callback that updates the `value` prop in order for the component to reflect user actions. If the `value` prop is not updated, the component will continue to render the supplied `value` prop instead of the expected result of any user actions.
ユーザーの操作を反映させるためには props の `value` を更新する必要があるため、`onValueChange`にコールバック関数を与えて `value` を更新させる必要があります。もし `value` が更新されない場合は、コンポーネントはユーザーの操作の結果期待される値の代わりに、渡された `value` を使い描画し続けてしまいます。

## Example

Expand Down Expand Up @@ -49,35 +49,36 @@ export default App;

### [View Props](view.md#props)

Inherits [View Props](view.md#props).
[View Props](view.md#props)を継承しています。

---

### `disabled`

If true the user won't be able to toggle the switch.
true の場合、ユーザーは switch の値を変更できません。

| Type | Default |
| | デフォルト値 |
| ---- | ------- |
| bool | `false` |

---

### `ios_backgroundColor` <div class="label ios">iOS</div>

On iOS, custom color for the background. This background color can be seen either when the switch value is `false` or when the switch is disabled (and the switch is translucent).
iOS 用の、カスタムバックグラウンドカラーです。このバックグラウンドカラーは、switch value false あるいは switch disabled が true の時(switch は半透明になります)に反映されます。

| Type |

| 型 |
| ------------------ |
| [color](colors.md) |

---

### `onChange`

Invoked when the user tries to change the value of the switch. Receives the change event as an argument. If you want to only receive the new value, use `onValueChange` instead.
ユーザーが switch の値を変更しようとした時に呼び出されます。引数として change event を受け取る事ができます。もしも、変更後の値のみを受け取りたい場合は、代わりに `onValueChange` を使用してください。

| Type |
| |
| -------- |
| function |

Expand All @@ -86,30 +87,33 @@ Invoked when the user tries to change the value of the switch. Receives the chan
### `onValueChange`

Invoked when the user tries to change the value of the switch. Receives the new value as an argument. If you want to instead receive an event, use `onChange`.
ユーザーが switch の値を変更しようとした時に呼び出されます。引数として変更後の値を受け取ります。もしも、値の代わりに event を受け取りたい場合は `onChange` を使用してください。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも、英文が残ってるようです、、!


| Type |
| |
| -------- |
| function |

---

### `thumbColor`

Color of the foreground switch grip. If this is set on iOS, the switch grip will lose its drop shadow.
switch のつまみの部分の色です。もし iOS でこのプロパティを設定した場合、つまみの drop shadow は消えます。
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これはむずかしかったです・・・。つまみって言いますよね・・・??
他にいい言葉があればお願いします 🙇🏻

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

つまみでしっくりきました👌


| Type |
| |
| ------------------ |
| [color](colors.md) |

---

### `trackColor`

Custom colors for the switch track.
switch の可動域の色です。
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これも難しいです・・・なにかいい言葉あればお教えください。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

track、難しいですね、、可動域でいいのではと思います!


_iOS_: When the switch value is `false`, the track shrinks into the border. If you want to change the color of the background exposed by the shrunken track, use [`ios_backgroundColor`](switch.md#ios_backgroundColor).

| Type |
_iOS_: switch の value が false の時は可動域の色は境界の中まで縮小されてしまいます。もし、縮小してる状態の背景色を変更したい場合は[`ios_backgroundColor`](switch.md#ios_backgroundColor)を使用してください。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも英文が残ってるようです


| 型 |
| --------------------------------------------------------------- |
| object: { false: [color](colors.md), true: [color](colors.md) } |

Expand All @@ -118,7 +122,8 @@ _iOS_: When the switch value is `false`, the track shrinks into the border. If y
### `value`

The value of the switch. If true the switch will be turned on. Default value is false.
switch の値です。もし true であれば switch はオンになります。デフォルト値は false です。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも英文が残ってるようです


| Type |
| |
| ---- |
| bool |