N N
N N

Reputation: 1638

How to append a button to TextField in Material UI

How can I append a button to a TextField like in bootstrap input group? Bootstrap button append

I tried this, but it is too ugly:

<TextField fullWidth
            variant="outlined"
            label="Add Something"
            InputProps={
                {
                    endAdornment: (
                        <InputAdornment position="end">
                            <Button
                                aria-label="Add"
                                edge="end"
                                color="primary"
                                variant="contained"
                            >
                                ADD
                            </Button>
                        </InputAdornment>
                    )
                }
            }
/>

Upvotes: 4

Views: 9011

Answers (1)

Hamidreza
Hamidreza

Reputation: 1546

<FormGroup row>
  <TextField variant="outlined" placeholder="username" />
  <Button variant="contained" disableElevation>
    @example.com
  </Button>
</FormGroup>

Edit pedantic-pasteur-x8d7b

Upvotes: 14

Related Questions