FabModel

23 Sep 20253 minutes to read

Interface for a class Fab

Properties

created EmitType<Event>

Triggers once the component rendering is completed.

content string

Defines the text content of the Button element.

    import { render } from "react-dom";
    import "./index.css";
    import * as React from "react";
    import { ButtonComponent } from "@syncfusion/ej2-react-buttons";
    import { SampleBase } from "./sample-base";

    export class Default extends SampleBase {
        content = "Normal";
  
        render() {
            return (
            <ButtonComponent cssClass="e-primary" content={this.content}></ButtonComponent>
        );}
    }

    render(<Default />, document.getElementById("sample"));

cssClass string

Defines class/multiple classes separated by a space in the Button element. The Button types, styles, and
size can be defined by using
this.

    import { render } from "react-dom";
    import "./index.css";
    import * as React from "react";
    import { ButtonComponent } from "@syncfusion/ej2-react-buttons";
    import { SampleBase } from "./sample-base";

    export class Default extends SampleBase {
        primary_class = "e-primary";
  
        render() {
            return (
            <ButtonComponent cssClass={this.primary_class} content="Normal"></ButtonComponent>
        );}
    }

    render(<Default />, document.getElementById("sample"));

disabled boolean

Specifies a value that indicates whether the Button is disabled or not.

enableHtmlSanitizer boolean

Specifies whether to enable the rendering of untrusted HTML values in the Button component.
If ‘enableHtmlSanitizer’ set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.

enablePersistence boolean

Enable or disable persisting component’s state between page reloads.

enableRtl boolean

Enable or disable rendering component in right to left direction.

iconCss string

Defines class/multiple classes separated by a space for the Button that is used to include an icon.
Buttons can also include font icon and sprite image.

iconPosition string|IconPosition

Positions the icon before/after the text content in the Button.
The possible values are:

  • Left: The icon will be positioned to the left of the text content.
  • Right: The icon will be positioned to the right of the text content.

isPrimary boolean

Defines whether to apply primary style for FAB.

isToggle boolean

Makes the Button toggle, when set to true. When you click it, the state changes from normal to active.

position string|FabPosition

Defines the position of the FAB relative to target.
The possible values are:

  • TopLeft: Positions the FAB at the target’s top left corner.
  • TopCenter: Positions the FAB at the target’s top left corner.
  • TopRight: Positions the FAB at the target’s top left corner.
  • MiddleLeft: Positions the FAB at the target’s top left corner.
  • MiddleCenter: Positions the FAB at the target’s top left corner.
  • MiddleRight: Positions the FAB at the target’s top left corner.
  • BottomLeft: Positions the FAB at the target’s top left corner.
  • BottomCenter: Places the FAB on the bottom-center position of the target.
  • BottomRight: Positions the FAB at the target’s bottom right corner.
import * as React from 'react';
import './style.css';
import { FabComponent } from '@syncfusion/ej2-react-buttons';

export default function App() {
  return (
    <div>
      <FabComponent content='fab' position='BottomLeft'></FabComponent>
    </div>
  );
}

target string|HTMLElement

Defines the selector that points to an element in which the FAB will be positioned.
By default, FAB is positioned based on viewport of browser.
The target element must have relative position, else FAB will get positioned based on the closest element which has relative position.

visible boolean

Defines whether the fab is visible or hidden.