Etch component
Floating Actions 1
A button floating at the bottom right of the screen that opens the site's actions: contact links and a main button. With one action, the button is that action. It shows on phones and tablets, and on wide screens when you turn it on.
Documentation
A button floating at the bottom right of the screen that opens the site's actions: contact links and a main button. With one action, the button is that action. It shows on phones and tablets, and on wide screens with its CSS recipe.
How to use it
- Set Label ("Contact") and an Icon, such as a phone or a message. Close Label ("Close") shows while it's open.
- Put MAC CTA 2s in Links, with their icon at the start and a
tel:,mailto:or WhatsApp link, and one or two MAC CTA 1s in Actions. An empty slot leaves its part out. - For a single action, set a Link, such as a
tel:link with "Call us" and a phone icon: the button is the link, with no panel. - Place it once, where it applies: in the footer's template for every page, or in one template, such as a property's.
- To keep it at every width, when the header doesn't show the same actions, paste its CSS recipe, below, in the site's
mainstylesheet.
Good to know
- It hides on pages with MAC TOC 1, whose button takes the same corner.
- The page keeps room for it at its bottom, so the end of the page and a focused field never sit under it. MAC Footer 1, 2 and 3 make that room; a footer of your own adds
var(--mac-floating-actions-1-height, 0px)to its bottom padding. - The open Menu panel covers it.
- Without its recipe, it shows in Etch's builder only when the canvas is as narrow as a phone.
- The CSS variables set its colors, line, shadow and spacing, and the panel's width.
CSS recipes
It hides on screens over 992px wide, where MAC Menu 1 shows the header's links. The recipe changes every Floating Actions 1 on the site. Paste it in the site's main stylesheet, which Etch prints after the components' styles. The hub's previews show it at every width.
On wide screens too
For a site whose header doesn't show the same actions, the button at every width. It still hides on pages with MAC TOC 1.
/* Floating Actions 1 on wide screens too */
.mac-floating-actions-1 {
display: block;
}