CoreUI Angular Logo
Framework:
  • JavaScript / Vanilla JS
  • React.js
  • Vue.js
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewDate PickerPRODate Range PickerPROForm ControlSelectMulti SelectPROChecks & RadiosPassword InputPRORangeRange SliderPRORatingPROStepperPROInput GroupFloating LabelsLayoutTime PickerPROValidationComponentsAccordionAlertAvatarBadgeBreadcrumbButtonButton GroupCalendarPROCalloutCardCarouselClose buttonCollapseDropdownFooterHeaderImageList GroupLoading ButtonPROModalNavNavbarOffcanvasPaginationPlaceholderPopoverProgressSmart PaginationPROSmart TablePROSidebarSpinnerTableTabsNewToastTooltipWidgetsIconsChartsTemplatesNewAdmin & DashboardDownloadInstallationCustomizeContentMigrationv4 → v5v3 → v4Angular version


DownloadHire UsGet CoreUI PRO
On this page

Angular Floating Labels Component

Angular floating label component. Create beautifully simple form labels that float over your input fields.

Example

Wrap a pair of cFormControl and label elements in cFormControl to enable floating labels with textual form fields. A placeholder is required on each input as our method of CSS-only floating labels uses the :placeholder-shown pseudo-element. Also note that the cFormControl must come first so we can utilize a sibling selector (ex., ~).

Loading...
Loading...

When there's a value already defined, cLabel will automatically adjust to their floated position.

Loading...
Loading...

Textareas

By default, textarea will be the same height as input.

Loading...
Loading...

To set a custom height on your textarea, do not use the rows attribute. Instead, set an explicit height (either inline or via custom CSS).

Loading...
Loading...

Selects

Other than input, floating labels are only available on cSelect. They work in the same way, but unlike input, it always shows the cLabel in its floated state.

Selects with size and multiple are not supported.

Loading...
Loading...

Layout

When working with the CoreUI for Bootstrap grid system, be sure to place form elements within column classes.

Loading...
Loading...

API reference

Form Module


cFormFloating

directive

Inputs
name description type default
cFormFloating Enable floating labels. boolean true
  • GitHub
  • Twitter
  • Support
  • CoreUI (Vanilla)
  • CoreUI for React.js
  • CoreUI for Vue.js

CoreUI for Angular is Open Source UI Components Library for Angular.

Currently v5.5.1 Code licensed MIT , docs CC BY 3.0 .
CoreUI PRO requires a commercial license.