Positions in Angular Floating action button component
27 Apr 20247 minutes to read
The floating action button can be positioned anywhere on the target
using the position
property. If the target
is not defined, then FAB is positioned based on the browser viewport.
The position values of Floating Action Button are as follows:
- TopLeft
- TopCenter
- TopRight
- MiddleLeft
- MiddleCenter
- MiddleRight
- BottomLeft
- BottomCenter
- BottomRight
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `<!-- To Render Floating Action Button in BottomLeft position. -->
<button ejs-fab id='fab' content='Add' position='BottomLeft'></button>`
})
export class AppComponent { }
Below example demonstrates different supported positions of FAB.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { FabModule } from '@syncfusion/ej2-angular-buttons'
import { Component } from '@angular/core';
@Component({
imports: [
FabModule
],
standalone: true,
selector: 'app-root',
template: `<div id="target" style="position:relative;min-height:350px;border:1px solid;"></div>
<!-- To Render Floating Action Button in TopLeft position. -->
<button ejs-fab id="fab1" iconCss='fab-icons fab-icon-people' position='TopLeft'
target='#target'></button>
<!-- To Render Floating Action Button in TopCenter position. -->
<button ejs-fab id="fab2" iconCss='fab-icons fab-icon-people' position='TopCenter'
target='#target'></button>
<!-- To Render Floating Action Button in TopRight position. -->
<button ejs-fab id="fab3" iconCss='fab-icons fab-icon-people' position='TopRight'
target='#target'></button>
<!-- To Render Floating Action Button in MiddleLeft position. -->
<button ejs-fab id="fab4" iconCss='fab-icons fab-icon-people'position='MiddleLeft'
target='#target'></button>
<!-- To Render Floating Action Button in MiddleCenter position. -->
<button ejs-fab id="fab5" iconCss='fab-icons fab-icon-people' position='MiddleCenter'
target='#target'></button>
<!-- To Render Floating Action Button in MiddleRight position. -->
<button ejs-fab id="fab6" iconCss='fab-icons fab-icon-people' position='MiddleRight'
target='#target'></button>
<!-- To Render Floating Action Button in BottomLeft position. -->
<button ejs-fab id="fab7" iconCss='fab-icons fab-icon-people' position='BottomLeft'
target='#target'></button>
<!-- To Render Floating Action Button in BottomCenter position. -->
<button ejs-fab id="fab8" iconCss='fab-icons fab-icon-people' position='BottomCenter'
target='#target'></button>
<!-- To Render Floating Action Button in BottomRight position. -->
<button ejs-fab id="fab9" iconCss='fab-icons fab-icon-people' position='BottomRight'
target='#target'></button>`
})
export class AppComponent { }
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
/* Represents the styles for loader */
#loader {
color: #008cff;
height: 40px;
left: 45%;
position: absolute;
top: 45%;
width: 30%;
}
/* Represents the Styles for fab icon */
@font-face {
font-family: 'fab-icons';
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj1tSgIAAAEoAAAAVmNtYXDnYOfNAAAByAAAAFZnbHlmkfZLRAAAAkgAABboaGVhZCF5f3EAAADQAAAANmhoZWEIUQQTAAAArAAAACRobXR4SAAAAAAAAYAAAABIbG9jYTveNR4AAAIgAAAAJm1heHABIQIXAAABCAAAACBuYW1lkwSegQAAGTAAAAIxcG9zdKKfPWYAABtkAAAAzQABAAAEAAAAAFwEAAAAAAAD9AABAAAAAAAAAAAAAAAAAAAAEgABAAAAAQAAbzQqW18PPPUACwQAAAAAAN8znUAAAAAA3zOdQAAAAAAD9AP0AAAACAACAAAAAAAAAAEAAAASAgsABQAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5wDnEAQAAAAAXAQAAAAAAAABAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABCAAAABAAEAAEAAOcQ//8AAOcA//8AAAABAAQAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAAAAAAAABpAPmBFQEggSaBK4FQAXsBrgG1AfcCBA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AGUAdAByAG8AIABTAHQAdQBkAGkAbwB3AHcAdwAuAHMAeQBuAGMAZgB1AHMAaQBvAG4ALgBjAG8AbQAAAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMABXNoYXJlCHNoYXJlLTAxBGVkaXQHZWRpdC0wMQNhZGQHdXBhcnJvdwVoZWFydANtYXAMdm9pY2Utc2VhcmNoCWZhdm9yaXRlcwtjaGF0LXBlcnNvbghib29rbWFyawhzaG9wcGluZwRwbGF5BXBhdXNlCHJlbWluZGVyCHNldHRpbmdzAAAAAAA=) format('truetype');
font-weight: normal;
font-style: normal;
}
[class^="fab-icon-"],
[class*=" fab-icon-"] {
font-family: 'fab-icons' !important;
speak: none;
font-size: 55px;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fab-icon-people:before {
content: "\e70a";
}
Custom position
You can define the custom position of the Floating Action Button by override the top
, left
, right
, and bottom
CSS properties using cssClass
. For detailed information, refer index.css
file below.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { FabModule } from '@syncfusion/ej2-angular-buttons'
import { Component } from '@angular/core';
@Component({
imports: [
FabModule
],
standalone: true,
selector: 'app-root',
template: `<div id="targetElement" style="position:relative;min-height:350px;border:1px solid;">
</div>
<!-- To Render Floating Action Button -->
<button ejs-fab id='fab' iconCss= 'e-icons e-edit' cssClass= 'custom-position' target='#targetElement'></button>`
})
export class AppComponent { }
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
/* Represents the styles for loader */
#loader {
color: #008cff;
height: 40px;
left: 45%;
position: absolute;
top: 45%;
width: 30%;
}
/* Represents the styles for button positioning */
#fab.e-fab.e-btn.custom-position {
left: 40px;
top: 40px;
bottom: unset;
right: unset;
}