When using Icon Circle Button, the icon must be clear a clear indication of what the button does because there is no text. Icon Circle Buttons take up less space on the page compared to normal buttons. The link variant is used for times you only want to have an icon for a button without having a background.
import React from 'react' import CircleIconButton from 'playbook-ui' const CircleIconButtonDefault = (props) => ( <div> <CircleIconButton icon="plus" variant="primary" /> <br /> <CircleIconButton icon="pen" variant="secondary" /> <br /> <CircleIconButton disabled icon="times" /> <br /> <CircleIconButton icon="user" variant="link" /> </div> ) export default CircleIconButtonDefault
The link
prop accepts a string that is used as an href value and causes the button to act as a link. The default behavior of a link is to open in the current window. You can optionally alter the link behavior by adding the newWindow
prop (boolean), which will open the link in a new window, or by calling the target
prop, which accepts _self
, _blank
, _parent
, _top
, child
, or any string, allowing you to specify any link target.
import React from 'react' import CircleIconButton from 'playbook-ui' const CircleIconButtonLink = (props) => ( <div> <CircleIconButton icon="search" link="https://google.com" variant="primary" /> <br /> <CircleIconButton icon="window" link="https://google.com" newWindow variant="secondary" /> <br/> <CircleIconButton aria={{ label: "Link to Playbook in new window" }} icon="info" link="https://playbook.powerapp.cloud/" target="child" variant="secondary" /> </div> ) export default CircleIconButtonLink
import React from 'react' import CircleIconButton from 'playbook-ui' const CircleIconButtonLoading = (props) => ( <div> <CircleIconButton icon="plus" loading variant="primary" /> <br /> <CircleIconButton icon="pen" loading variant="secondary" /> <br /> <CircleIconButton disabled icon="times" loading /> <br /> <CircleIconButton icon="user" loading variant="link" /> </div> ) export default CircleIconButtonLoading