Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Update Switch docs to reflect latest changes",
"packageName": "@fluentui-react-native/switch",
"email": "winlarry@microsoft.com",
"dependentChangeType": "patch"
}
5 changes: 2 additions & 3 deletions packages/components/Switch/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The `Switch` component has six slots. The slots behave as follows:
- `thumb` - By default a circle. Its location informs the user of the Switch's toggle state.
- `toggleContainer` - Container for the thumb and track.
- `onOffText` - If specified, renders the the toggle state of the Switch as text.
- `onOffTextContainer` - If `onText` or `offText` are passed, this is the container that holds such text.

The slots can be modified using the `compose` function on the `Switch`. For more information on using the `compose` API, please see [this page](../../framework/composition/README.md).

Expand Down Expand Up @@ -96,9 +97,7 @@ export interface SwitchProps extends Omit<PressablePropsExtended 'onPress'> {
onText?: string;

/**
* Sets the position of the Switch's label. The position value 'after' is mutually
* exclusive with the onText and offText props. This is due to variable width
* of the text props causing the Switch's position to change when it shouldn't.
* The position of the label relative to the Switch.
* Note : 'before' , 'above' are not supported on Android
*/
labelPosition?: 'before' | 'above' | 'after';
Expand Down
6 changes: 2 additions & 4 deletions packages/components/Switch/src/Switch.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,8 @@ export interface SwitchProps extends Omit<PressablePropsExtended, 'onPress'> {
onText?: string;

/**
* The position of the label relative to the Switch. The position value 'after' is mutually
* exclusive with the onText and offText props. This is due to variable width
* of the text props causing the Switch's position to change when it shouldn't.
* Note :'before', 'above' are not supported on Android
* The position of the label relative to the Switch.
* Note : 'before' , 'above' are not supported on Android
*/
labelPosition?: 'before' | 'above' | 'after';

Expand Down