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.
<%= pb_rails("circle_icon_button", props: { variant: "primary", icon: "plus" }) %> <br/> <%= pb_rails("circle_icon_button", props: { variant: "secondary", icon: "pen" }) %> <br/> <%= pb_rails("circle_icon_button", props: { disabled: true, icon: "times" }) %> <br/> <%= pb_rails("circle_icon_button", props: { variant: "link", icon: "user" }) %>
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.
<%= pb_rails("circle_icon_button", props: { variant: "primary", icon: "search", link: "https://google.com" }) %> <br/> <%= pb_rails("circle_icon_button", props: { variant: "secondary", icon: "window", link: "https://google.com", new_window: true }) %> <br/> <%= pb_rails("circle_icon_button", props: { icon: "info", variant: "secondary", aria: { label: "Link to Playbook in new window" }, link: "https://playbook.powerapp.cloud/", target: "child" }) %>
<%= pb_rails("circle_icon_button", props: { variant: "primary", icon: "plus", loading: true }) %> <br/> <%= pb_rails("circle_icon_button", props: { variant: "secondary", icon: "pen", loading: true }) %> <br/> <%= pb_rails("circle_icon_button", props: { disabled: true, icon: "times", loading: true }) %> <br/> <%= pb_rails("circle_icon_button", props: { variant: "link", icon: "user", loading: true }) %>
The size prop accepts "sm" as a value to make the Circle Icon Button 20px x 20px instead of the default 40px x 40px size.
<%= pb_rails("flex", props: { orientation: "column", gap: "sm" }) do %> <%= pb_rails("circle_icon_button", props: { icon: "plus", size: "sm", variant: "primary" }) %> <%= pb_rails("circle_icon_button", props: { icon: "pen", loading: true, size: "sm", variant: "secondary" }) %> <%= pb_rails("circle_icon_button", props: { disabled: true, icon: "times", size: "sm" }) %> <%= pb_rails("circle_icon_button", props: { icon: "info", link: "https://playbook.powerapp.cloud/", size: "sm", target: "child", variant: "link" }) %> <% end %>
Use the input_options prop to pass additional attributes directly to the internal Playbook Button component. While the wrapper div has access to the standard data prop from KitBase, input_options allows you to attach attributes specifically to the internal button element.
This is particularly useful when you need data attributes or other HTML attributes to apply to the button itself.
<%= pb_rails("circle_icon_button", props: { icon: "plus", input_options: { data: { "test-id": "add-button", remote: true }, } }) %> <br/> <%= pb_rails("circle_icon_button", props: { icon: "pen", variant: "secondary", input_options: { data: { "test-id": "edit-button" }, classname: "custom-secondary-button-class" } }) %> <br/> <%= pb_rails("circle_icon_button", props: { icon: "user", variant: "link", input_options: { data: { "test-id": "user-button" }, id: "user-button-id" } }) %>
| Props | Type | Values |
|---|---|---|
align_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
align_items |
enum | responsive
|
start
end
center
|
border_radius |
enum
|
none
xs
sm
md
lg
xl
rounded
|
cursor |
enum
|
auto
default
none
contextMenu
help
pointer
progress
wait
cell
|
dark |
boolean
|
true
false
|
flex |
enum | responsive
|
auto
initial
0
1
2
3
4
5
6
7
8
9
10
11
12
none
|
flex_direction |
enum | responsive
|
row
column
rowReverse
columnReverse
|
flex_wrap |
enum | responsive
|
wrap
nowrap
wrapReverse
|
justify_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
line_height |
enum
|
loosest
looser
loose
normal
tight
tighter
tightest
|
margin_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin |
array
|
none
xxs
xs
sm
md
lg
xl
|
width |
string
|
|
min_width |
string
|
|
max_width |
string
|
|
gap |
string | responsive
|
|
column_gap |
string | responsive
|
|
row_gap |
string | responsive
|
|
number_spacing |
enum
|
tabular
|
order |
enum | responsive
|
none
first
1
2
3
4
5
6
7
8
9
10
11
12
|
overflow_x |
enum
|
scroll
visible
hidden
auto
|
overflow_y |
enum
|
scroll
visible
hidden
auto
|
overflow |
enum
|
scroll
visible
hidden
auto
|
padding_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding |
array
|
none
xxs
xs
sm
md
lg
xl
|
position |
enum
|
relative
absolute
fixed
sticky
static
|
shadow |
enum
|
none
deep
deeper
deepest
|
text_align |
enum | responsive
|
start
end
left
right
center
justify
justifyAll
matchParent
|
truncate |
enum
|
none
1
2
3
4
5
|
vertical_align |
enum | responsive
|
baseline
super
top
middle
bottom
sub
text-top
text-bottom
|
z_index |
enum | responsive
|
1
2
3
4
5
6
7
8
9
10
max
|
top |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
inset |
boolean
|
true
false
|
right |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
bottom |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
left |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
height |
string
|
|
max_height |
string
|
|
min_height |
string
|
|
hover |
object
|
|
group_hover |
boolean
|
true
false
|
| Props | Type | Values | Default |
|---|---|---|---|
disabled |
boolean
|
true
false
|
false
|
icon |
string
|
||
link |
string
|
||
loading |
boolean
|
true
false
|
false
|
on_click |
reactnode
|
||
new_window |
boolean
|
true
false
|
false
|
type |
enum
|
button
submit
reset
|
button
|
target |
string
|
||
variant |
enum
|
primary
secondary
link
|
primary
|
size |
enum
|
default
sm
|
default
|
input_options |
string
|