Material-UI radio buttons with "outlined" variant

Viewed 588

I could not find a way to display Radio Buttons with the "outlined" variant from FormControl. To create an annotation form a am using React and MaterialUI.

Example:

Example

As you can see in the image above, the radio button field does not match the others.
Simply adding variant="outlined" to the FormControl does not work.

I wonder if this is even possible.
WBR

1 Answers

My solution was to use a fieldset like this:

<Grid item component='fieldset' className={classes.outlined}>
   <FormLabel component="legend">Title</FormLabel>
... radio buttons ..
</Grid>

and then use the theme to set the colour of the text etc.

const useStyles = makeStyles((theme: Theme) =>
  createStyles({
    outlined: {
      borderWidth: 1,
      borderColor: theme.palette.grey[300],
      borderStyle: 'solid',
      borderRadius: 3
    },
  }),
);
Related