Movatterモバイル変換


[0]ホーム

URL:


CoreUI Angular Logo
Framework:
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewAutocompletePRODate 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 Offcanvas Component

Angular Offcanvas component allows to build hidden sidebars into your project for navigation, shopping carts, etc.

Examples

Live demo

Use the buttons below to show and hide an offcanvas component.

Offcanvas Header

Content for the offcanvas goes here. You can place just about any CoreUI component or custom elements here.

Loading...
Loading...

Placement

There's no default placement for offcanvas components, so you must add one of the modifier props below;

  • placement="start" places offcanvas on the left of the viewport (shown above)
  • placement="end" places offcanvas on the right of the viewport
  • placement="top" places offcanvas on the top of the viewport
  • placement="bottom" places offcanvas on the bottom of the viewport
Offcanvas Header

Content for the offcanvas goes here. You can place just about any CoreUI component or custom elements here.

Offcanvas Header

Content for the offcanvas goes here. You can place just about any CoreUI component or custom elements here.

Offcanvas Header

Content for the offcanvas goes here. You can place just about any CoreUI component or custom elements here.

Loading...
Loading...

Backdrop and Scroll

Scrolling thebody element is disabled when an offcanvas and its backdrop are visible. Use thescroll property to toggle body scrolling andbackdrop to toggle the backdrop.

Offcanvas Header

Try scrolling the rest of the page to see this option in action.

Offcanvas Header

Try scrolling the rest of the page to see this option in action.

Loading...
Loading...

Static Backdrop

Withbackdrop prop set tostatic, the offcanvas will not close when clicking outside of it nor pressingEsc.

Offcanvas Header

I will not close if you try to click outside of me or to press escape key.

Loading...
Loading...

Responsive

Responsive offcanvas hides the content outside the viewport below the specified breakpoint. Above that breakpoint, the content is displayed as usual.

Resize your browser to show the responsive offcanvas toggle button.
Responsive offcanvas Header

This is content within an offcanvas withresponsive="lg" property.

Loading...
Loading...

Dark offcanvas

With.text-bg-dark utility class you can change the appearance of your offcanvas component.

Dark Offcanvas Header

Content for the dark offcanvas goes here.

Loading...
Loading...

Accessibility

Since the offcanvas panel is conceptually a modal dialog, be sure to addaria-labelledby="..." —referencing the offcanvas title— toc-offcanvas>. Note that you don’t need to addrole="dialog" since we already add it automatically.


API reference

Offcanvas Module

import { OffcanvasModule } from '@coreui/angular';@NgModule({   imports: [OffcanvasModule,]})export class AppModule() { }

c-offcanvas

component

Inputs
namedescriptiontypedefaultversion
backdropApply a backdrop on body while offcanvas is visible.boolean | 'static'truestatic4.3.10+
keyboardCloses the offcanvas when escape key is pressed.booleantrue
idHtml id attr, required for programmatic offcanvas visibility change.stringrequired
placementOffcanvas placement.start |end |top |bottomstart
responsiveHide the content in an offcanvas below the breakpoint.boolean | sm | md | lg | xl | xxltrue4.3.10+
scrollAllow body scrolling while offcanvas is open.booleanfalse
visibleToggle the offcanvas visibility.booleanundefined
roleHtmlrole for an offcanvas.stringdialog
aria-modalSetaria-modal html attr for an offcanvas.stringtrue
Outputs
namedescriptiontype
visibleChangeEvent emitted onvisible change.boolean

c-offcanvas-body

component

c-offcanvas-header

component

cOffcanvasTitle

directive

cOffcanvasToggle

directive

Inputs
namedescriptiontypedefault
cOffcanvasToggleHtml elementid attr of an offcanvas to dismiss.stringrequired

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

Currently v5.5.17 Code licensed MIT, docs CC BY 3.0 .
CoreUI PRO requires acommercial license.


[8]ページ先頭

©2009-2025 Movatter.jp