Hide Button while using IconButton
See original GitHub issueI want to display Icon & allow it to be clickable which is why I need the IconButton
component.
The problem comes when I need to show only icon but hide the button and I’m unable to do that.
Here’s the contents of my IconButton
⸺
import { Flex, IconButton } from '@chakra-ui/core'
import React from 'react'
export const CreateHabit = () => (
<Flex
width='220px'
height='220px'
borderRadius='40px'
margin='0 16px'
padding='0 16px'
justify='center'
flexWrap='wrap'
>
<IconButton
onClick={() => alert('click')}
icon='add'
variant='unstyled'
fontSize='300px'
/>
</Flex>
)
And right now you can see how it looks ⸺
Notice the button’s outline above the add icon. I want to hide the button completely so that my icon will move up a bit in alignment 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to display an IconButton that is hidden on button click ...
Show activity on this post. I have in my ViewModel class, a State object with the default value of false . Nothing happens....
Read more >Hide and show a button based on the content of the Gallery
I have a problem with showing and hiding an icon/button. I want to make the Gallery button invisible while the Gallery is still...
Read more >IconButton API - Material UI - MUI
API reference docs for the React IconButton component. Learn about the props, CSS, and other APIs of this exported module.
Read more >IconButton class - material library - Flutter - Dart API docs
When creating an icon button with an Icon, do not override the icon's size with its Icon.size parameter, use the icon button's iconSize...
Read more >Button Icons - Lightning Design System
If an icon button doesn't include a label, use a title attribute to show on hover for ... When using assistive text, the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those still looking for a way to work with ally/tab
The secret is the variant and the
fit-content
I’d suggest you use the
PseudoBox
component to create that button.Let me know if this helps. If not, I’ll re-open the issue