-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add Typescript example for switch label position (#16959)
- Loading branch information
1 parent
c07aeed
commit 5301c24
Showing
2 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
docs/src/pages/components/switches/FormControlLabelPosition.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import Switch from '@material-ui/core/Switch'; | ||
import FormGroup from '@material-ui/core/FormGroup'; | ||
import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||
import FormControl from '@material-ui/core/FormControl'; | ||
|
||
export default function FormControlLabelPosition() { | ||
return ( | ||
<FormControl component="fieldset"> | ||
<FormGroup aria-label="position" row> | ||
<FormControlLabel | ||
value="top" | ||
control={<Switch color="primary" />} | ||
label="Top" | ||
labelPlacement="top" | ||
/> | ||
<FormControlLabel | ||
value="start" | ||
control={<Switch color="primary" />} | ||
label="Start" | ||
labelPlacement="start" | ||
/> | ||
<FormControlLabel | ||
value="bottom" | ||
control={<Switch color="primary" />} | ||
label="Bottom" | ||
labelPlacement="bottom" | ||
/> | ||
<FormControlLabel | ||
value="end" | ||
control={<Switch color="primary" />} | ||
label="End" | ||
labelPlacement="end" | ||
/> | ||
</FormGroup> | ||
</FormControl> | ||
); | ||
} |