Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to round button in Svelte Material UI

I need a circle button using sveltemateriaui. There isn’t any similar example in https://sveltematerialui.com/demo/button but trying to get it using plain css I’ve got it this: https://svelte.dev/repl/8cc5be4c6b1245e88aa9a12c7fc550dc?version=3.37.0 is not a circle, is an ellipse.

The only way that I got it is to set width and height more than 50 px, but in this case, the button is too large.

How can I get a circle button with icon close centered vertically and horizontally?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I think what you’re looking for is a floating action button:

<Fab variant="raised">
    <Icon class="material-icons">close</Icon>
</Fab>

<script>
  import Fab, { Icon } from '@smui/fab';
</script>

Svelte Material UI docs
Example REPL

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading