diff --git a/docs/switch.md b/docs/switch.md index 365755d61ee..e16c29fcbb7 100644 --- a/docs/switch.md +++ b/docs/switch.md @@ -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 @@ -49,15 +49,15 @@ 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` | @@ -65,9 +65,10 @@ If true the user won't be able to toggle the switch. ### `ios_backgroundColor`
iOS
-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) | @@ -75,9 +76,9 @@ On iOS, custom color for the background. This background color can be seen eithe ### `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 | @@ -86,8 +87,9 @@ 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` を使用してください。 -| Type | +| 型 | | -------- | | function | @@ -95,9 +97,9 @@ Invoked when the user tries to change the value of the switch. Receives the new ### `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 は消えます。 -| Type | +| 型 | | ------------------ | | [color](colors.md) | @@ -105,11 +107,13 @@ Color of the foreground switch grip. If this is set on iOS, the switch grip will ### `trackColor` -Custom colors for the switch track. +switch の可動域の色です。 _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)を使用してください。 + +| 型 | | --------------------------------------------------------------- | | object: { false: [color](colors.md), true: [color](colors.md) } | @@ -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 です。 -| Type | +| 型 | | ---- | | bool |