Fixed Confirmation Toast is used as an alert. Success is used when a user successfully completes an action. Error is used when there is an error and the user cannot proceed. Neutral is used to display information to a user to complete a task.
<%= pb_rails("fixed_confirmation_toast", props: { text: "Error Message", status: "error", closeable: true })%> <br><br> <%= pb_rails("fixed_confirmation_toast", props: { text: "Items Successfully Moved", status: "success" })%> <br><br> <%= pb_rails("fixed_confirmation_toast", props: { text: "Scan to Assign Selected Items", status: "neutral" })%>
Multi-line is used when the given text will not fit on one line. Using Multi Line allows the height of the confirmation toast to grow. Simply resize the screen to see the fixed confirmation toast wrap the text.
<%= pb_rails("button", props: { text: "Short Multiline", variant: "secondary", data: { multitoast: "#toast-short" } }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "multitoast-to-hide", closeable: true, id: "toast-short", multi_line: true, text: "Multi-line is used when the given text will not fit on one line.", status: "tip", vertical: "top", horizontal: "center" }) %> <%= pb_rails("button", props: { text: "Long Multiline", variant: "secondary", data: { multitoast: "#toast-long" } }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "multitoast-to-hide", closeable: true, id: "toast-long", multi_line: true, text: "Multi-line is used when the given text will not fit on one line. Using Multi Line allows the height of the confirmation toast to grow. Simply resize the screen to see the fixed confirmation toast wrap the text.", status: "tip", vertical: "top", horizontal: "center" }) %> <script type="text/javascript"> const multitoasts = document.querySelectorAll(".multitoast-to-hide") const multibuttons = document.querySelectorAll("button[data-multitoast]") const hideMultiToasts = () => { multitoasts.forEach((toast) => { toast.style.display = "none" }) } multibuttons.forEach((button) => { button.onclick = () => { hideMultiToasts() let toast = document.querySelector(button.getAttribute("data-multitoast")) if (toast) { toast.style.display = "flex" } } }) </script> <!-- hiding toast on page load --> <style> #toast-long, #toast-short { display: none; } </style>
<%= pb_rails("fixed_confirmation_toast", props: { text: "Error Message", status: "error", closeable: true })%> <br><br> <%= pb_rails("fixed_confirmation_toast", props: { text: "Items Successfully Moved", status: "success", closeable: true })%> <br><br> <%= pb_rails("fixed_confirmation_toast", props: { text: "Scan to Assign Selected Items", status: "neutral", closeable: true })%>
<%= pb_rails("button", props: { text: "Top Center", variant: "secondary", data: { toast: "#toast-top-center" } }) %> <%= pb_rails("button", props: { text: "Top Left", variant: "secondary", data: { toast: "#toast-top-left" } }) %> <%= pb_rails("button", props: { text: "Top Right", variant: "secondary", data: { toast: "#toast-top-right" } }) %> <%= pb_rails("button", props: { text: "Bottom Center", variant: "secondary", data: { toast: "#toast-bottom-center" } }) %> <%= pb_rails("button", props: { text: "Bottom Left", variant: "secondary", data: { toast: "#toast-bottom-left" } }) %> <%= pb_rails("button", props: { text: "Bottom Right", variant: "secondary", data: { toast: "#toast-bottom-right" } }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "toast-to-hide", closeable: true, id: "toast-top-center", text: "Top Center", status: "neutral", vertical: "top", horizontal: "center" }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "toast-to-hide", closeable: true, id: "toast-top-left", text: "Top Left", status: "neutral", vertical: "top", horizontal: "left" }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "toast-to-hide", closeable: true, id: "toast-top-right", text: "Top Right", status: "neutral", vertical: "top", horizontal: "right" }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "toast-to-hide", closeable: true, id: "toast-bottom-center", text: "Bottom Center", status: "neutral", vertical: "bottom", horizontal: "center" }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "toast-to-hide", closeable: true, id: "toast-bottom-left", text: "Bottom Left", status: "neutral", vertical: "bottom", horizontal: "left" }) %> <%= pb_rails("fixed_confirmation_toast", props: { classname: "toast-to-hide", closeable: true, id: "toast-bottom-right", text: "Bottom Right", status: "neutral", vertical: "bottom", horizontal: "right" }) %> <script type="text/javascript"> const toasts = document.querySelectorAll(".toast-to-hide") const buttons = document.querySelectorAll("button[data-toast]") const hideToasts = () => { toasts.forEach((toast) => { toast.style.display = "none" }) } buttons.forEach((button) => { button.onclick = () => { hideToasts() let toast = document.querySelector(button.getAttribute("data-toast")) if (toast) { toast.style.display = "flex" } } }) </script> <!-- hiding toast on page load --> <style> #toast-top-center, #toast-top-right, #toast-top-left, #toast-bottom-center, #toast-bottom-right, #toast-bottom-left { display: none; } </style>
Pass anything (including any of our kits) to the children
prop to customize the content of the fixed confirmation toast.
NOTE: passing children
overrides any content passed to text
<%= pb_rails("fixed_confirmation_toast", props: { padding_y: "none", status: "success" }) do %> <%= pb_rails("title", props: { dark: true, margin_left: "md", text: "Design & Handoff Process was moved to UX Designer Learning Track.", size: 4 }) %> <%= pb_rails("button", props: { dark: true, padding_right: "none", text: "Undo", variant: "link" }) %> <% end %>
<div> <%= pb_rails("fixed_confirmation_toast", props: { icon: "wrench", text: "Fix before proceeding", status: "error", closeable: true, margin_bottom: "md" })%> </div> <div> <%= pb_rails("fixed_confirmation_toast", props: { icon: "star", text: "Thank you for completing the form!", status: "success", margin_bottom: "md" })%> </div> <div> <%= pb_rails("fixed_confirmation_toast", props: { icon: "file-pdf", text: "Saved as PDF", status: "neutral", margin_bottom: "md" })%> </div> <div> <%= pb_rails("fixed_confirmation_toast", props: { icon: "arrow-down", text: "New Messages", status: "tip" })%> </div>
Props | Type | Values |
---|---|---|
max_width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
min_width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
z_index |
array
|
1
2
3
4
5
6
7
8
9
10
|
number_spacing |
array
|
tabular
|
shadow |
array
|
none
deep
deeper
deepest
|
line_height |
array
|
tightest
tighter
tight
normal
loose
looser
loosest
|
display |
array
|
block
inline_block
inline
flex
inline_flex
none
|
cursor |
array
|
auto
default
none
contextMenu
help
pointer
progress
wait
cell
crosshair
text
verticalText
alias
copy
move
noDrop
notAllowed
grab
grabbing
eResize
nResize
neResize
nwResize
sResize
seResize
swResize
wResize
ewResize
nsResize
neswResize
nwseResize
colResize
rowResize
allScroll
zoomIn
zoomOut
|
flex_direction |
array
|
row
column
rowReverse
columnReverse
|
flex_wrap |
array
|
wrap
nowrap
wrapReverse
|
justify_content |
array
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
justify_self |
array
|
auto
start
end
center
stretch
|
align_items |
array
|
flexStart
flexEnd
start
end
center
baseline
stretch
|
align_content |
array
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
align_self |
array
|
auto
start
end
center
stretch
baseline
|
flex |
array
|
auto
initial
0
1
2
3
4
5
6
7
8
9
10
11
12
none
|
flex_grow |
array
|
1
0
|
flex_shrink |
array
|
1
0
|
order |
array
|
1
2
3
4
5
6
7
8
9
10
11
12
|
position |
array
|
relative
absolute
fixed
sticky
|
hover |
array
|
|
border_radius |
array
|
none
xs
sm
md
lg
xl
rounded
|
text_align |
array
|
start
end
left
right
center
justify
justify-all
match-parent
|
overflow |
array
|
visible
hidden
scroll
auto
|
truncate |
array
|
1
2
3
4
5
|
left |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
top |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
right |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
bottom |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
vertical_align |
array
|
baseline
super
top
middle
bottom
sub
text-top
text-bottom
|
height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
min_height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
max_height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
overflow_x |
array
|
visible
hidden
scroll
auto
|
overflow_y |
array
|
visible
hidden
scroll
auto
|
margin |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_top |
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
|
padding |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_top |
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
|
classname |
string
|
|
dark |
boolean
|
|
group_hover |
boolean
|
|
id |
string
|
|
data |
hashprop
|
|
aria |
hashprop
|
|
html_options |
hashprop
|
|
children |
proc
|
|
style |
hashprop
|
Props | Type | Values | Default |
---|---|---|---|
status |
enum
|
success
error
neutral
tip
|
neutral
|
text |
string
|
||
multi_line |
boolean
|
false
|
|
closeable |
boolean
|
false
|
|
horizontal |
enum
|
right
left
center
|
|
vertical |
enum
|
top
bottom
|
|
auto_close |
number
|
||
icon |
string
|