Icon button
#763
-
|
How would I create Icon button? |
Beta Was this translation helpful? Give feedback.
Answered by
prbxr
Oct 13, 2020
Replies: 2 comments 1 reply
-
|
Hi! Reakit provides a import Button from 'reakit/Button`
import searchIcon from './icons/search.svg'
import plusIcon from './icons/plus.svg'
const icons = {
Search: searchIcon,
Plus: plusIcon,
}
function IconButton({ icon }) {
return <Button><img src={icons[icon]} alt={`${icon} icon`} /></Button>
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Yes, but svg has some accessability settings such as: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lishine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, but svg has some accessability settings such as:
https://github.com/chakra-ui/chakra-ui/blob/develop/packages/button/src/icon-button.tsx