Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Joy UI] Add
FormControl
component (#34187)
- Loading branch information
1 parent
adda22c
commit 420e4a7
Showing
47 changed files
with
1,177 additions
and
256 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
import Checkbox from '@mui/joy/Checkbox'; | ||
import FormControl from '@mui/joy/FormControl'; | ||
import FormHelperText from '@mui/joy/FormHelperText'; | ||
|
||
export default function HelperTextCheckbox() { | ||
return ( | ||
<FormControl> | ||
<Checkbox label="Label" /> | ||
<FormHelperText>A description for the checkbox.</FormHelperText> | ||
</FormControl> | ||
); | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -1,31 +1,20 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import FormControl from '@mui/joy/FormControl'; | ||
import FormLabel from '@mui/joy/FormLabel'; | ||
import FormHelperText from '@mui/joy/FormHelperText'; | ||
import Radio from '@mui/joy/Radio'; | ||
import RadioGroup from '@mui/joy/RadioGroup'; | ||
import Typography from '@mui/joy/Typography'; | ||
|
||
export default function RadioButtonsGroup() { | ||
return ( | ||
<Box> | ||
<Typography | ||
id="demo-radio-buttons-group-label" | ||
level="body3" | ||
textTransform="uppercase" | ||
fontWeight="xl" | ||
sx={{ letterSpacing: '0.15rem' }} | ||
mb={2} | ||
> | ||
Gender | ||
</Typography> | ||
<RadioGroup | ||
aria-labelledby="demo-radio-buttons-group-label" | ||
defaultValue="female" | ||
name="radio-buttons-group" | ||
> | ||
<FormControl> | ||
<FormLabel>Gender</FormLabel> | ||
<RadioGroup defaultValue="female" name="radio-buttons-group" sx={{ my: 1 }}> | ||
<Radio value="female" label="Female" /> | ||
<Radio value="male" label="Male" /> | ||
<Radio value="other" label="Other" /> | ||
</RadioGroup> | ||
</Box> | ||
<FormHelperText>This is a helper text.</FormHelperText> | ||
</FormControl> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,41 +1,25 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import FormControl from '@mui/joy/FormControl'; | ||
import FormLabel from '@mui/joy/FormLabel'; | ||
import FormHelperText from '@mui/joy/FormHelperText'; | ||
import Radio, { radioClasses } from '@mui/joy/Radio'; | ||
import RadioGroup from '@mui/joy/RadioGroup'; | ||
import Typography from '@mui/joy/Typography'; | ||
|
||
export default function RadioFocus() { | ||
return ( | ||
<Box> | ||
<Typography | ||
id="demo-radio-buttons-group-focus" | ||
level="body3" | ||
textTransform="uppercase" | ||
fontWeight="xl" | ||
sx={{ letterSpacing: '0.15rem' }} | ||
mb={2} | ||
> | ||
Focus | ||
</Typography> | ||
<RadioGroup | ||
aria-labelledby="demo-radio-buttons-group-focus" | ||
aria-describedby="demo-radio-buttons-group-focus-description" | ||
name="radio-buttons-group-focus" | ||
> | ||
<FormControl> | ||
<FormLabel>Focus</FormLabel> | ||
<RadioGroup name="radio-buttons-group-focus" sx={{ my: 1 }}> | ||
<Radio value="default" label="Default" /> | ||
<Radio | ||
value="relative" | ||
label="Position relative" | ||
sx={{ [`& .${radioClasses.radio}`]: { position: 'relative' } }} | ||
/> | ||
</RadioGroup> | ||
<Typography | ||
level="body3" | ||
mt={2} | ||
id="demo-radio-buttons-group-focus-description" | ||
> | ||
<FormHelperText> | ||
Select an option and use keyboard ↑↓ to see the focus outline | ||
</Typography> | ||
</Box> | ||
</FormHelperText> | ||
</FormControl> | ||
); | ||
} |
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
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
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
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
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
Oops, something went wrong.